Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(http): 50109 error, invalid JSON #1338

Merged
merged 2 commits into from
Dec 18, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions http/src/api_error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,8 @@ pub enum ErrorCode {
ServerNeedsMonetiazation,
/// This server needs more boosts to perform this action
ServerNeedsBoosts,
/// The request body contains invalid JSON.
RequestInvalidJson,
/// Two factor is required for this operation.
TwoFactorRequired,
/// No users with DiscordTag exist
Expand Down Expand Up @@ -434,6 +436,7 @@ impl ErrorCode {
Self::ServerNotAvailableLocation => 50095,
Self::ServerNeedsMonetiazation => 50097,
Self::ServerNeedsBoosts => 50101,
Self::RequestInvalidJson => 50109,
Self::TwoFactorRequired => 60003,
Self::NoSuchUser => 80004,
Self::ReactionBlocked => 90001,
Expand Down Expand Up @@ -587,6 +590,7 @@ impl From<u64> for ErrorCode {
50095 => Self::ServerNotAvailableLocation,
50097 => Self::ServerNeedsMonetiazation,
50101 => Self::ServerNeedsBoosts,
50109 => Self::RequestInvalidJson,
60003 => Self::TwoFactorRequired,
80004 => Self::NoSuchUser,
90001 => Self::ReactionBlocked,
Expand Down Expand Up @@ -740,6 +744,7 @@ impl Display for ErrorCode {
Self::ServerNotAvailableLocation => f.write_str("This server is not available in your location"),
Self::ServerNeedsMonetiazation => f.write_str("This server needs monetization enabled in order to perform this action"),
Self::ServerNeedsBoosts => f.write_str("This server needs more boosts to perform this action"),
Self::RequestInvalidJson => f.write_str("The request body contains invalid JSON"),
Self::TwoFactorRequired => f.write_str("Two factor is required for this operation"),
Self::NoSuchUser => f.write_str("No users with DiscordTag exist"),
Self::ReactionBlocked => f.write_str("Reaction was blocked"),
Expand Down