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 ClientAuthenticationException represents an exception thrown when client authentication fails with
a status code of 4XX, typically 401 unauthorized.
This exception is thrown in the following scenarios:
- The client did not send the required authorization credentials to access the requested resource, i.e., the Authorization HTTP header is missing in the request.
- The request contains the HTTP Authorization header, but authorization has been refused for the credentials contained in the request header.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionClientAuthenticationException(String message, HttpResponse response) Initializes a new instance of theClientAuthenticationExceptionclass.ClientAuthenticationException(String message, HttpResponse response, Object value) Initializes a new instance of theClientAuthenticationExceptionclass.ClientAuthenticationException(String message, HttpResponse response, Throwable cause) Initializes a new instance of theClientAuthenticationExceptionclass. -
Method Summary
Methods inherited from class com.azure.core.exception.HttpResponseException
getResponse, getValueMethods 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 theClientAuthenticationExceptionclass.- 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 theClientAuthenticationExceptionclass.- 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 theClientAuthenticationExceptionclass.- Parameters:
message- The exception message or the response content if a message is not available.response- The HTTP response with the authorization failure.cause- TheThrowablewhich caused the creation of this exception.
-