Class ErrorResponseException

  • All Implemented Interfaces:
    java.io.Serializable

    public class ErrorResponseException
    extends java.lang.RuntimeException
    Indicates an unhandled error that is returned by Discord API Request using RestAction
    It holds an ErrorResponse
    See Also:
    Serialized Form
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static ErrorResponseException create​(ErrorResponse errorResponse, net.dv8tion.jda.core.requests.Response response)  
      java.lang.Throwable getCause()  
      int getErrorCode()
      The discord error code for this error response.
      ErrorResponse getErrorResponse()
      The ErrorResponse corresponding for the received error response from Discord
      java.lang.String getMeaning()
      The meaning for this error.
      net.dv8tion.jda.core.requests.Response getResponse()
      The Discord Response causing the ErrorResponse
      boolean isServerError()
      Whether this is an internal server error from discord (status 500)
      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • 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 java.lang.String getMeaning()
        The meaning for this error.
        It is possible that the value from this method is different for server 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
      • getResponse

        public net.dv8tion.jda.core.requests.Response getResponse()
        The Discord Response causing the ErrorResponse
        Returns:
        Response
      • getCause

        public java.lang.Throwable getCause()
        Overrides:
        getCause in class java.lang.Throwable