Skip to content

Commit

Permalink
revert: ex can be in senex since it's not read by sentry itself, rath…
Browse files Browse the repository at this point in the history
…er if u manually call it

might need more fixes
  • Loading branch information
Lulalaby committed Jun 7, 2024
1 parent 9cb90ee commit 50ccaa2
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions DisCatSharp/Net/Rest/RestClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -563,8 +563,7 @@ private async Task ExecuteRequestAsync(BaseRestRequest request, RateLimitBucket?
case HttpStatusCode.BadRequest:
case HttpStatusCode.MethodNotAllowed:
ex = new BadRequestException(request, response);
// ex won't be added to avoid possible leaks
senex = new(ex.Message + "\nJson Response: " + ((ex as BadRequestException)?.JsonMessage ?? "null"));
senex = new(ex.Message + "\nJson Response: " + ((ex as BadRequestException)?.JsonMessage ?? "null"), ex);
break;

case HttpStatusCode.Unauthorized:
Expand Down Expand Up @@ -629,8 +628,7 @@ private async Task ExecuteRequestAsync(BaseRestRequest request, RateLimitBucket?
case HttpStatusCode.ServiceUnavailable:
case HttpStatusCode.GatewayTimeout:
ex = new ServerErrorException(request, response);
// ex won't be added to avoid possible leaks
senex = new(ex.Message + "\nJson Response: " + ((ex as ServerErrorException)!.JsonMessage ?? "null"));
senex = new(ex.Message + "\nJson Response: " + ((ex as ServerErrorException)!.JsonMessage ?? "null"), ex);
break;
}

Expand Down

0 comments on commit 50ccaa2

Please sign in to comment.