diff options
author | Dylam De La Torre <DyXel04@gmail.com> | 2021-11-23 05:21:56 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-23 04:21:56 +0000 |
commit | a51a54bc5979a2491f152abc47ad54e6b63f27c8 (patch) | |
tree | ce67092b2f6df366033a65a6111e4650866766b2 /src/discord/errors.hpp | |
parent | d88079000a79e6bcbe51c5a2868d57b303b5fcb6 (diff) | |
download | abaddon-portaudio-a51a54bc5979a2491f152abc47ad54e6b63f27c8.tar.gz abaddon-portaudio-a51a54bc5979a2491f152abc47ad54e6b63f27c8.zip |
Restructure source and resource files (#46)
importantly, res is now res/res and css is now res/css
Diffstat (limited to 'src/discord/errors.hpp')
-rw-r--r-- | src/discord/errors.hpp | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/discord/errors.hpp b/src/discord/errors.hpp new file mode 100644 index 0000000..4579563 --- /dev/null +++ b/src/discord/errors.hpp @@ -0,0 +1,36 @@ +#pragma once + +enum class DiscordError { + GENERIC = 0, + INVALID_FORM_BODY = 50035, + RELATIONSHIP_INCOMING_DISABLED = 80000, + RELATIONSHIP_INCOMING_BLOCKED = 80001, + RELATIONSHIP_INVALID_USER_BOT = 80002, // this is misspelled in discord's source lul + RELATIONSHIP_INVALID_SELF = 80003, + RELATIONSHIP_INVALID_DISCORD_TAG = 80004, + RELATIONSHIP_ALREADY_FRIENDS = 80007, + + NONE = -1, +}; + +constexpr const char *GetDiscordErrorDisplayString(DiscordError error) { + switch (error) { + case DiscordError::INVALID_FORM_BODY: + return "Something's wrong with your input"; + case DiscordError::RELATIONSHIP_INCOMING_DISABLED: + return "This user isn't accepting friend requests"; + case DiscordError::RELATIONSHIP_INCOMING_BLOCKED: + return "You are blocked by this user"; + case DiscordError::RELATIONSHIP_INVALID_USER_BOT: + return "You can't send a request to a bot"; + case DiscordError::RELATIONSHIP_INVALID_SELF: + return "You can't send a request to yourself"; + case DiscordError::RELATIONSHIP_INVALID_DISCORD_TAG: + return "No users with that tag exist"; + case DiscordError::RELATIONSHIP_ALREADY_FRIENDS: + return "You are already friends with that user"; + case DiscordError::GENERIC: + default: + return "An error occurred"; + } +} |