Interface DiscordExceptionInstantiator<T extends DiscordException>

  • Type Parameters:
    T - The type of the discord exception that is produced.
    Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.


    @FunctionalInterface
    public interface DiscordExceptionInstantiator<T extends DiscordException>
    Represents a function that accepts four arguments (Exception, String, RestRequest<?> and RestRequestResult) and produces a discord exception of type T.
    • Method Detail

      • createInstance

        T createInstance​(Exception origin,
                         String message,
                         RestRequestInformation request,
                         RestRequestResponseInformation response)
        Creates a new instance of the class T.
        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.
        Returns:
        The new instance.