Skip to content

Commit

Permalink
Improve capture of EDDN server errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Tkael committed Nov 20, 2022
1 parent dabe46c commit ec10124
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions EDDNResponder/Sender/EDDNSender.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ private static void sendMessage(EDDNBody body)
// Invalid status codes are defined at https://github.com/EDCD/EDDN/blob/master/docs/Developers.md#server-responses
case HttpStatusCode.BadRequest: // Code 400
{
throw new ArgumentException();
throw new ArgumentException(response.Content);
}
case HttpStatusCode.RequestTimeout: // Code 408
case HttpStatusCode.GatewayTimeout: // Code 504
Expand Down Expand Up @@ -130,7 +130,8 @@ private static void sendMessage(EDDNBody body)
Logging.Debug("Response content is " + response.Content);
if (response.StatusCode != HttpStatusCode.Accepted)
{
throw new WebException("Failed to resend to EDDN service with compressed data.");
var iex = new Exception(response.Content);
throw new WebException("Failed to resend to EDDN service with compressed data.", iex);
}
break;
}
Expand Down

0 comments on commit ec10124

Please sign in to comment.