Added in API level 34

GetCredentialException


open class GetCredentialException : Exception
kotlin.Any
   ↳ kotlin.Throwable
   ↳ java.lang.Exception
   ↳ android.credentials.GetCredentialException

Represents an error encountered during the CredentialManager.getCredential(Context, GetCredentialRequest, operation.

Summary

Constants
static String

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

static String

The error type value for when no credential is found available for the given android.credentials.CredentialManager#getCredential(android.content.Context,android.credentials.GetCredentialRequest,android.os.CancellationSignal,java.util.concurrent.Executor,android.os.OutcomeReceiver) request.

static String

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

static String

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

Public constructors

Constructs a GetCredentialException.

Constructs a GetCredentialException.

GetCredentialException(type: String, message: String?, cause: Throwable?)

Constructs a GetCredentialException.

Constructs a GetCredentialException.

Public methods
open String

Returns the specific exception type.

Constants

TYPE_INTERRUPTED

Added in API level 34
static val TYPE_INTERRUPTED: String

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

Value: "android.credentials.GetCredentialException.TYPE_INTERRUPTED"

TYPE_NO_CREDENTIAL

Added in API level 34
static val TYPE_NO_CREDENTIAL: String

The error type value for when no credential is found available for the given android.credentials.CredentialManager#getCredential(android.content.Context,android.credentials.GetCredentialRequest,android.os.CancellationSignal,java.util.concurrent.Executor,android.os.OutcomeReceiver) request.

Value: "android.credentials.GetCredentialException.TYPE_NO_CREDENTIAL"

TYPE_UNKNOWN

Added in API level 34
static val TYPE_UNKNOWN: String

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

Value: "android.credentials.GetCredentialException.TYPE_UNKNOWN"

TYPE_USER_CANCELED

Added in API level 34
static val TYPE_USER_CANCELED: String

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.

Value: "android.credentials.GetCredentialException.TYPE_USER_CANCELED"

Public constructors

GetCredentialException

Added in API level 34
GetCredentialException(type: String)

Constructs a GetCredentialException.

Parameters
type String: This value cannot be null.
Exceptions
java.lang.IllegalArgumentException If type is empty.

GetCredentialException

Added in API level 34
GetCredentialException(
    type: String,
    message: String?)

Constructs a GetCredentialException.

Parameters
type String: This value cannot be null.
message String?: This value may be null.
Exceptions
java.lang.IllegalArgumentException If type is empty.

GetCredentialException

Added in API level 34
GetCredentialException(
    type: String,
    message: String?,
    cause: Throwable?)

Constructs a GetCredentialException.

Parameters
type String: This value cannot be null.
message String?: This value may be null.
cause Throwable?: This value may be null.
Exceptions
java.lang.IllegalArgumentException If type is empty.

GetCredentialException

Added in API level 34
GetCredentialException(
    type: String,
    cause: Throwable?)

Constructs a GetCredentialException.

Parameters
type String: This value cannot be null.
cause Throwable?: This value may be null.
Exceptions
java.lang.IllegalArgumentException If type is empty.

Public methods

getType

Added in API level 34
open fun getType(): String

Returns the specific exception type.

Return
String This value cannot be null.