Package com.azure.core.exception
Class ClientAuthenticationException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.azure.core.exception.AzureException
com.azure.core.exception.HttpResponseException
com.azure.core.exception.ClientAuthenticationException
- All Implemented Interfaces:
Serializable
The exception thrown when failed to authenticate the client request with status code of 4XX, typically 401
unauthorized.
A runtime exception indicating request authorization failure caused by one of the following scenarios:
- A client did not send the required authorization credentials to access the requested resource, i.e. Authorization HTTP header is missing in the request
- If the request contains the HTTP Authorization header, then the exception indicates that authorization has been refused for the credentials contained in the request header.
- See Also:
-
Constructor Summary
ConstructorDescriptionClientAuthenticationException
(String message, HttpResponse response) Initializes a new instance of theClientAuthenticationException
class.ClientAuthenticationException
(String message, HttpResponse response, Object value) Initializes a new instance of theClientAuthenticationException
class.ClientAuthenticationException
(String message, HttpResponse response, Throwable cause) Initializes a new instance of theClientAuthenticationException
class. -
Method Summary
Methods inherited from class com.azure.core.exception.HttpResponseException
getResponse, getValue
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
ClientAuthenticationException
Initializes a new instance of theClientAuthenticationException
class.- Parameters:
message
- The exception message or the response content if a message is not available.response
- The HTTP response with the authorization failure.
-
ClientAuthenticationException
Initializes a new instance of theClientAuthenticationException
class.- Parameters:
message
- The exception message or the response content if a message is not available.response
- The HTTP response with the authorization failure.value
- The deserialized HTTP response value.
-
ClientAuthenticationException
Initializes a new instance of theClientAuthenticationException
class.- Parameters:
message
- The exception message or the response content if a message is not available.response
- The HTTP response with the authorization failure.cause
- TheThrowable
which caused the creation of this exception.
-