Package net.dv8tion.jda.api.exceptions
Class ErrorResponseException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- net.dv8tion.jda.api.exceptions.ErrorResponseException
-
- All Implemented Interfaces:
Serializable
public class ErrorResponseException extends RuntimeException
Indicates an unhandled error that is returned by Discord API Request usingRestAction
It holds anErrorResponse
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ErrorResponseException
create(ErrorResponse errorResponse, Response response)
int
getErrorCode()
The discord error code for this error response.ErrorResponse
getErrorResponse()
TheErrorResponse
corresponding for the received error response from DiscordString
getMeaning()
The meaning for this error.Response
getResponse()
The Discord Response causing the ErrorResponseboolean
isServerError()
Whether this is an internal server error from discord (status 500)-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Method Detail
-
isServerError
public boolean isServerError()
Whether this is an internal server error from discord (status 500)- Returns:
- True, if this is an internal server error
ErrorResponse.SERVER_ERROR
-
getMeaning
public String getMeaning()
The meaning for this error.
It is possible that the value from this method is different forserver errors
- Returns:
- Never-null meaning of this error.
-
getErrorCode
public int getErrorCode()
The discord error code for this error response.- Returns:
- The discord error code.
- See Also:
- Discord Error Codes
-
getErrorResponse
public ErrorResponse getErrorResponse()
TheErrorResponse
corresponding for the received error response from Discord- Returns:
ErrorResponse
-
getResponse
public Response getResponse()
The Discord Response causing the ErrorResponse- Returns:
Response
-
create
public static ErrorResponseException create(ErrorResponse errorResponse, Response response)
-
-