CreateCredentialException


public class CreateCredentialException
extends Exception

java.lang.Object
   ↳ java.lang.Throwable
     ↳ java.lang.Exception
       ↳ android.credentials.CreateCredentialException


Represents an error encountered during the CredentialManager#createCredential(Context, CreateCredentialRequest, CancellationSignal, Executor, OutcomeReceiver) operation.

Summary

Constants

String TYPE_INTERRUPTED

The error type value for when the given operation failed due to internal interruption.

String TYPE_NO_CREATE_OPTIONS

The error type value for when no create options are available from any provider(s), for the given CredentialManager#createCredential(Context, CreateCredentialRequest, CancellationSignal, Executor, OutcomeReceiver) request.

String TYPE_UNKNOWN

The error type value for when the given operation failed due to an unknown reason.

String TYPE_USER_CANCELED

The error type value for when the user intentionally cancelled the request.

Public constructors

CreateCredentialException(String type, String message)

Constructs a CreateCredentialException.

CreateCredentialException(String type, String message, Throwable cause)

Constructs a CreateCredentialException.

CreateCredentialException(String type, Throwable cause)

Constructs a CreateCredentialException.

CreateCredentialException(String type)

Constructs a CreateCredentialException.

Public methods

String getType()

Returns the specific exception type.

Inherited methods

Constants

TYPE_INTERRUPTED

Added in API level 34
public static final String TYPE_INTERRUPTED

The error type value for when the given operation failed due to internal interruption. Retrying the same operation should fix the error.

Constant Value: "android.credentials.CreateCredentialException.TYPE_INTERRUPTED"

TYPE_NO_CREATE_OPTIONS

Added in API level 34
public static final String TYPE_NO_CREATE_OPTIONS

The error type value for when no create options are available from any provider(s), for the given CredentialManager#createCredential(Context, CreateCredentialRequest, CancellationSignal, Executor, OutcomeReceiver) request.

Constant Value: "android.credentials.CreateCredentialException.TYPE_NO_CREATE_OPTIONS"

TYPE_UNKNOWN

Added in API level 34
public static final String TYPE_UNKNOWN

The error type value for when the given operation failed due to an unknown reason.

Constant Value: "android.credentials.CreateCredentialException.TYPE_UNKNOWN"

TYPE_USER_CANCELED

Added in API level 34
public static final String TYPE_USER_CANCELED

The error type value for when the user intentionally cancelled the request.

This is a strong indicator that your app should refrain from making the same api call for a certain amount of time to provide a better user experience.

Constant Value: "android.credentials.CreateCredentialException.TYPE_USER_CANCELED"

Public constructors

CreateCredentialException

Added in API level 34
public CreateCredentialException (String type, 
                String message)

Constructs a CreateCredentialException.

Parameters
type String: This value cannot be null.

message String: This value may be null.

Throws
IllegalArgumentException If type is empty.

CreateCredentialException

Added in API level 34
public CreateCredentialException (String type, 
                String message, 
                Throwable cause)

Constructs a CreateCredentialException.

Parameters
type String: This value cannot be null.

message String: This value may be null.

cause Throwable: This value may be null.

Throws
IllegalArgumentException If type is empty.

CreateCredentialException

Added in API level 34
public CreateCredentialException (String type, 
                Throwable cause)

Constructs a CreateCredentialException.

Parameters
type String: This value cannot be null.

cause Throwable: This value may be null.

Throws
IllegalArgumentException If type is empty.

CreateCredentialException

Added in API level 34
public CreateCredentialException (String type)

Constructs a CreateCredentialException.

Parameters
type String: This value cannot be null.

Throws
IllegalArgumentException If type is empty.

Public methods

getType

Added in API level 34
public String getType ()

Returns the specific exception type.

Returns
String This value cannot be null.