Package com.jsgalactic.axiom.error
Class UnauthorizedException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.jsgalactic.axiom.error.AxiomException
com.jsgalactic.axiom.error.UnauthorizedException
- All Implemented Interfaces:
Serializable
A request without valid credentials (401). The response carries the caller-supplied
WWW-Authenticate challenge, which must be a constant chosen by the application (for example
Bearer realm="api"), never a value taken from the request.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionUnauthorizedException(String challenge) Creates the exception with codeunauthorized.UnauthorizedException(String challenge, String code) Creates the exception with a specific safe code. -
Method Summary
Methods inherited from class com.jsgalactic.axiom.error.AxiomException
code, headers, status, violationsMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
UnauthorizedException
Creates the exception with codeunauthorized.- Parameters:
challenge- WWW-Authenticate value: an auth scheme, optionally followed by a space and parameters, in visible ASCII- Throws:
IllegalArgumentException- for an invalid or unsafe challenge
-
UnauthorizedException
Creates the exception with a specific safe code.- Parameters:
challenge- WWW-Authenticate valuecode- machine-readable code- Throws:
IllegalArgumentException- for an invalid or unsafe challenge
-