Package net.dv8tion.jda.api.requests
Enum ErrorResponse
- java.lang.Object
-
- java.lang.Enum<ErrorResponse>
-
- net.dv8tion.jda.api.requests.ErrorResponse
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<ErrorResponse>
public enum ErrorResponse extends java.lang.Enum<ErrorResponse>
Constants for easy use inErrorResponseException
andErrorHandler
.- See Also:
RestAction
,ErrorHandler
, Discord Error Codes
-
-
Enum Constant Summary
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ErrorResponse
fromCode(int code)
static ErrorResponse
fromJSON(DataObject obj)
int
getCode()
java.lang.String
getMeaning()
boolean
test(java.lang.Throwable throwable)
Tests whether the given throwable is anErrorResponseException
withErrorResponseException.getErrorResponse()
equal to this.static java.util.function.Predicate<java.lang.Throwable>
test(java.util.Collection<ErrorResponse> responses)
Provides a tests whether a given throwable is anErrorResponseException
withErrorResponseException.getErrorResponse()
being one of the provided responses.static java.util.function.Predicate<java.lang.Throwable>
test(ErrorResponse... responses)
Provides a tests whether a given throwable is anErrorResponseException
withErrorResponseException.getErrorResponse()
being one of the provided responses.static ErrorResponse
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static ErrorResponse[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
UNKNOWN_ACCOUNT
public static final ErrorResponse UNKNOWN_ACCOUNT
-
UNKNOWN_APPLICATION
public static final ErrorResponse UNKNOWN_APPLICATION
-
UNKNOWN_CHANNEL
public static final ErrorResponse UNKNOWN_CHANNEL
-
UNKNOWN_GUILD
public static final ErrorResponse UNKNOWN_GUILD
-
UNKNOWN_INTEGRATION
public static final ErrorResponse UNKNOWN_INTEGRATION
-
UNKNOWN_INVITE
public static final ErrorResponse UNKNOWN_INVITE
-
UNKNOWN_MEMBER
public static final ErrorResponse UNKNOWN_MEMBER
-
UNKNOWN_MESSAGE
public static final ErrorResponse UNKNOWN_MESSAGE
-
UNKNOWN_OVERRIDE
public static final ErrorResponse UNKNOWN_OVERRIDE
-
UNKNOWN_PROVIDER
public static final ErrorResponse UNKNOWN_PROVIDER
-
UNKNOWN_ROLE
public static final ErrorResponse UNKNOWN_ROLE
-
UNKNOWN_TOKEN
public static final ErrorResponse UNKNOWN_TOKEN
-
UNKNOWN_USER
public static final ErrorResponse UNKNOWN_USER
-
UNKNOWN_EMOJI
public static final ErrorResponse UNKNOWN_EMOJI
-
UNKNOWN_WEBHOOK
public static final ErrorResponse UNKNOWN_WEBHOOK
-
UNKNOWN_BAN
public static final ErrorResponse UNKNOWN_BAN
-
UNKNOWN_SKU
public static final ErrorResponse UNKNOWN_SKU
-
UNKNOWN_STORE_LISTING
public static final ErrorResponse UNKNOWN_STORE_LISTING
-
UNKNOWN_ENTITLEMENT
public static final ErrorResponse UNKNOWN_ENTITLEMENT
-
UNKNOWN_BUILD
public static final ErrorResponse UNKNOWN_BUILD
-
UNKNOWN_LOBBY
public static final ErrorResponse UNKNOWN_LOBBY
-
UNKNOWN_BRANCH
public static final ErrorResponse UNKNOWN_BRANCH
-
UNKNOWN_REDISTRIBUTABLE
public static final ErrorResponse UNKNOWN_REDISTRIBUTABLE
-
UNKNOWN_GUILD_TEMPLATE
public static final ErrorResponse UNKNOWN_GUILD_TEMPLATE
-
UNKNOWN_INTERACTION
public static final ErrorResponse UNKNOWN_INTERACTION
-
UNKNOWN_COMMAND
public static final ErrorResponse UNKNOWN_COMMAND
-
UNKNOWN_COMMAND_PERMISSIONS
public static final ErrorResponse UNKNOWN_COMMAND_PERMISSIONS
-
UNKNOWN_STAGE_INSTANCE
public static final ErrorResponse UNKNOWN_STAGE_INSTANCE
-
BOTS_NOT_ALLOWED
public static final ErrorResponse BOTS_NOT_ALLOWED
-
ONLY_BOTS_ALLOWED
public static final ErrorResponse ONLY_BOTS_ALLOWED
-
MAX_GUILDS
public static final ErrorResponse MAX_GUILDS
-
MAX_FRIENDS
public static final ErrorResponse MAX_FRIENDS
-
MAX_MESSAGE_PINS
public static final ErrorResponse MAX_MESSAGE_PINS
-
MAX_USERS_PER_DM
public static final ErrorResponse MAX_USERS_PER_DM
-
MAX_ROLES_PER_GUILD
public static final ErrorResponse MAX_ROLES_PER_GUILD
-
MAX_WEBHOOKS
public static final ErrorResponse MAX_WEBHOOKS
-
TOO_MANY_REACTIONS
public static final ErrorResponse TOO_MANY_REACTIONS
-
MAX_CHANNELS
public static final ErrorResponse MAX_CHANNELS
-
MAX_INVITES
public static final ErrorResponse MAX_INVITES
-
ALREADY_HAS_TEMPLATE
public static final ErrorResponse ALREADY_HAS_TEMPLATE
-
UNAUTHORIZED
public static final ErrorResponse UNAUTHORIZED
-
REQUEST_ENTITY_TOO_LARGE
public static final ErrorResponse REQUEST_ENTITY_TOO_LARGE
-
USER_NOT_CONNECTED
public static final ErrorResponse USER_NOT_CONNECTED
-
ALREADY_CROSSPOSTED
public static final ErrorResponse ALREADY_CROSSPOSTED
-
MISSING_ACCESS
public static final ErrorResponse MISSING_ACCESS
-
INVALID_ACCOUNT_TYPE
public static final ErrorResponse INVALID_ACCOUNT_TYPE
-
INVALID_DM_ACTION
public static final ErrorResponse INVALID_DM_ACTION
-
EMBED_DISABLED
public static final ErrorResponse EMBED_DISABLED
-
INVALID_AUTHOR_EDIT
public static final ErrorResponse INVALID_AUTHOR_EDIT
-
EMPTY_MESSAGE
public static final ErrorResponse EMPTY_MESSAGE
-
CANNOT_SEND_TO_USER
public static final ErrorResponse CANNOT_SEND_TO_USER
-
CANNOT_MESSAGE_VC
public static final ErrorResponse CANNOT_MESSAGE_VC
-
VERIFICATION_ERROR
public static final ErrorResponse VERIFICATION_ERROR
-
OAUTH_NOT_BOT
public static final ErrorResponse OAUTH_NOT_BOT
-
MAX_OAUTH_APPS
public static final ErrorResponse MAX_OAUTH_APPS
-
INVALID_OAUTH_STATE
public static final ErrorResponse INVALID_OAUTH_STATE
-
MISSING_PERMISSIONS
public static final ErrorResponse MISSING_PERMISSIONS
-
INVALID_TOKEN
public static final ErrorResponse INVALID_TOKEN
-
NOTE_TOO_LONG
public static final ErrorResponse NOTE_TOO_LONG
-
INVALID_BULK_DELETE
public static final ErrorResponse INVALID_BULK_DELETE
-
INVALID_MFA_LEVEL
public static final ErrorResponse INVALID_MFA_LEVEL
-
INVALID_PASSWORD
public static final ErrorResponse INVALID_PASSWORD
-
INVALID_PIN
public static final ErrorResponse INVALID_PIN
-
INVITE_CODE_INVALID
public static final ErrorResponse INVITE_CODE_INVALID
-
INVALID_MESSAGE_TARGET
public static final ErrorResponse INVALID_MESSAGE_TARGET
-
INVALID_OAUTH_ACCESS_TOKEN
public static final ErrorResponse INVALID_OAUTH_ACCESS_TOKEN
-
INVALID_WEBHOOK_TOKEN
public static final ErrorResponse INVALID_WEBHOOK_TOKEN
-
INVALID_BULK_DELETE_MESSAGE_AGE
public static final ErrorResponse INVALID_BULK_DELETE_MESSAGE_AGE
-
INVALID_FORM_BODY
public static final ErrorResponse INVALID_FORM_BODY
-
INVITE_FOR_UNKNOWN_GUILD
public static final ErrorResponse INVITE_FOR_UNKNOWN_GUILD
-
INVALID_API_VERSION
public static final ErrorResponse INVALID_API_VERSION
-
MFA_NOT_ENABLED
public static final ErrorResponse MFA_NOT_ENABLED
-
REACTION_BLOCKED
public static final ErrorResponse REACTION_BLOCKED
-
RESOURCES_OVERLOADED
public static final ErrorResponse RESOURCES_OVERLOADED
-
STAGE_ALREADY_OPEN
public static final ErrorResponse STAGE_ALREADY_OPEN
-
SERVER_ERROR
public static final ErrorResponse SERVER_ERROR
-
-
Method Detail
-
values
public static ErrorResponse[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (ErrorResponse c : ErrorResponse.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ErrorResponse valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
getCode
public int getCode()
-
getMeaning
@Nonnull public java.lang.String getMeaning()
-
test
public boolean test(java.lang.Throwable throwable)
Tests whether the given throwable is anErrorResponseException
withErrorResponseException.getErrorResponse()
equal to this.
This is very useful in combination withRestAction.onErrorMap(Predicate, Function)
andRestAction.onErrorFlatMap(Predicate, Function)
!- Parameters:
throwable
- The throwable to test- Returns:
- True, if the error response is equal to this
-
test
@Nonnull public static java.util.function.Predicate<java.lang.Throwable> test(@Nonnull ErrorResponse... responses)
Provides a tests whether a given throwable is anErrorResponseException
withErrorResponseException.getErrorResponse()
being one of the provided responses.
This is very useful in combination withRestAction.onErrorMap(Predicate, Function)
andRestAction.onErrorFlatMap(Predicate, Function)
!- Parameters:
responses
- The responses to test for- Returns:
Predicate
which returns true, if the error response is equal to this
-
test
@Nonnull public static java.util.function.Predicate<java.lang.Throwable> test(@Nonnull java.util.Collection<ErrorResponse> responses)
Provides a tests whether a given throwable is anErrorResponseException
withErrorResponseException.getErrorResponse()
being one of the provided responses.
This is very useful in combination withRestAction.onErrorMap(Predicate, Function)
andRestAction.onErrorFlatMap(Predicate, Function)
!- Parameters:
responses
- The responses to test for- Returns:
Predicate
which returns true, if the error response is equal to this
-
fromCode
@Nonnull public static ErrorResponse fromCode(int code)
-
fromJSON
@Nonnull public static ErrorResponse fromJSON(@Nullable DataObject obj)
-
-