Class TokenRequestException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.linecorp.armeria.common.auth.oauth2.TokenRequestException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
InvalidClientException, InvalidGrantException, InvalidRequestException, InvalidScopeException, UnauthorizedClientException, UnsupportedGrantTypeException, UnsupportedTokenTypeException

@UnstableApi public class TokenRequestException extends RuntimeException
A common token request exception type.
See Also:
  • Constructor Details

    • TokenRequestException

      public TokenRequestException(String errorDescription, @Nullable @Nullable String errorUri)
      Constructs a new TokenRequestException using errorDescription and errorUri.
      Parameters:
      errorDescription - OPTIONAL. Human-readable ASCII [USASCII] text providing additional information, used to assist the client developer in understanding the error that occurred. Values for the errorDescription parameter MUST NOT include characters outside the set %x20-21 / %x23-5B / %x5D-7E.
      errorUri - OPTIONAL. A URI identifying a human-readable web page with information about the error, used to provide the client developer with additional information about the error. Values for the errorUri parameter MUST conform to the URI-reference syntax and thus MUST NOT include characters outside the set %x21 / %x23-5B / %x5D-7E.
    • TokenRequestException

      public TokenRequestException(String errorDescription, @Nullable @Nullable String errorUri, Throwable cause)
      Constructs a new TokenRequestException using errorDescription and errorUri.
      Parameters:
      errorDescription - OPTIONAL. Human-readable ASCII [USASCII] text providing additional information, used to assist the client developer in understanding the error that occurred. Values for the errorDescription parameter MUST NOT include characters outside the set %x20-21 / %x23-5B / %x5D-7E.
      errorUri - OPTIONAL. A URI identifying a human-readable web page with information about the error, used to provide the client developer with additional information about the error. Values for the errorUri parameter MUST conform to the URI-reference syntax and thus MUST NOT include characters outside the set %x21 / %x23-5B / %x5D-7E.
      cause - the cause (which is saved for later retrieval by the Throwable.getCause() method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)
  • Method Details

    • parse

      public static TokenRequestException parse(String rawResponse)
      Parses JSON error response body and created a new instance of TokenRequestException using the response data. Returns an error-specific type of TokenRequestException.
      Parameters:
      rawResponse - JSON formatted error response body.
      Returns:
      a new instance of TokenRequestException
    • getErrorUri

      @Nullable public final @Nullable String getErrorUri()
      A URI identifying a human-readable web page with information about the error, used to provide the client developer with additional information about the error. Values for the errorUri parameter MUST conform to the URI-reference syntax and thus MUST NOT include characters outside the set %x21 / %x23-5B / %x5D-7E.