mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
fix(api): don't 500 on invalid PATCH body
This commit is contained in:
parent
a20f0916ac
commit
97c14b20b0
3 changed files with 21 additions and 5 deletions
|
|
@ -127,6 +127,10 @@ public static class APIErrorHandlerExt
|
|||
if (exc is FormatException && exc.Message.Contains("was not recognized as a valid DateTime"))
|
||||
return true;
|
||||
|
||||
// this happens if a user sends an empty JSON object for PATCH (or a JSON object with no valid keys)
|
||||
if (exc is InvalidPatchException)
|
||||
return true;
|
||||
|
||||
// This may expanded at some point.
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue