mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-07 14:27:54 +00:00
feat: add sentry error logging to dotnet-api and rust crates
This commit is contained in:
parent
8266100155
commit
63777bf810
8 changed files with 86 additions and 38 deletions
|
|
@ -62,8 +62,13 @@ public class Startup
|
|||
await ctx.Response.WriteJSON(400, "{\"message\":\"400: Bad Request\",\"code\":0}");
|
||||
|
||||
else if (exc.Error is not PKError)
|
||||
{
|
||||
await ctx.Response.WriteJSON(500, "{\"message\":\"500: Internal Server Error\",\"code\":0}");
|
||||
|
||||
var sentryEvent = new SentryEvent(exc.Error);
|
||||
SentrySdk.CaptureEvent(sentryEvent);
|
||||
}
|
||||
|
||||
// for some reason, if we don't specifically cast to ModelParseError, it uses the base's ToJson method
|
||||
else if (exc.Error is ModelParseError fe)
|
||||
await ctx.Response.WriteJSON(fe.ResponseCode, JsonConvert.SerializeObject(fe.ToJson()));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue