Class DiscordException

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Optional<RestRequestInformation> getRequest()
      Gets information about the request which caused the exception.
      java.util.Optional<RestRequestResponseInformation> getResponse()
      Gets information about the response which caused the exception.
      • Methods inherited from class java.lang.Throwable

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

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • DiscordException

        public DiscordException​(java.lang.Exception origin,
                                java.lang.String message,
                                RestRequestInformation request,
                                RestRequestResponseInformation response)
        Creates a new instance of this class.
        Parameters:
        origin - The origin of the exception.
        message - The message of the exception.
        request - The information about the request.
        response - The information about the response.
    • Method Detail

      • getRequest

        public java.util.Optional<RestRequestInformation> getRequest()
        Gets information about the request which caused the exception. May be null if the exception was thrown before creating a request.
        Returns:
        Information about the request which caused the exception.
      • getResponse

        public java.util.Optional<RestRequestResponseInformation> getResponse()
        Gets information about the response which caused the exception. May not be present if the exception was thrown before sending a request.
        Returns:
        Information about the response which caused the exception.