Exception

public class Exception
extends Throwable

java.lang.Object
   ↳ java.lang.Throwable
     ↳ java.lang.Exception
AccountsException  
AclNotFoundException This class was deprecated in API level 33. This class is deprecated and subject to removal in a future version of Java SE. It has been replaced by java.security.Policy and related classes since 1.2. 
AdServicesException Exception thrown by AdServices. 
AndroidException Base class for all checked exceptions thrown by the Android frameworks. 
AppSearchException An exception thrown by AppSearchSession or a subcomponent. 
BackingStoreException Thrown to indicate that a preferences operation could not complete because of a failure in the backing store, or a failure to contact the backing store. 
BrokenBarrierException Exception thrown when a thread tries to wait upon a barrier that is in a broken state, or which enters the broken state while the thread is waiting. 
CertificateException This exception indicates one of a variety of certificate problems. 
ClearCredentialStateException Represents an error encountered during the CredentialManager#clearCredentialState(ClearCredentialStateRequest, CancellationSignal, Executor, OutcomeReceiver) operation. 
CloneNotSupportedException Thrown to indicate that the clone method in class Object has been called to clone an object, but that the object's class does not implement the Cloneable interface. 
ConfirmationAlreadyPresentingException This exception is thrown when presenting a prompt fails because another prompt is already being presented. 
ConfirmationNotAvailableException This exception is thrown when presenting a prompt fails because the environment lacks facilities for showing confirmations. 
CreateCredentialException Represents an error encountered during the CredentialManager#createCredential(Context, CreateCredentialRequest, CancellationSignal, Executor, OutcomeReceiver) operation. 
DataFormatException Signals that a data format error has occurred. 
DatatypeConfigurationException

Indicates a serious configuration error. 

DestroyFailedException Signals that a destroy operation failed. 
DnsResolver.DnsException Class to represent DNS error 
ErrnoException A checked exception thrown when Os methods fail. 
ExecutionException Exception thrown when attempting to retrieve the result of a task that aborted by throwing an exception. 
FormatException  
GeneralSecurityException The GeneralSecurityException class is a generic security exception class that provides type safety for all the security-related exception classes that extend from it. 
GetCredentialException Represents an error encountered during the CredentialManager#getCredential(Context, GetCredentialRequest, CancellationSignal, Executor, OutcomeReceiver) operation. 
IOException Signals that an I/O exception of some sort has occurred. 
IdentityCredentialException Base class for all Identity Credential exceptions. 
IkeException IkeException represents a generic exception that includes internal and protocol exceptions. 
ImsException This class defines an IMS-related exception that has been thrown while interacting with a device or carrier provided ImsService implementation. 
InterruptedException Thrown when a thread is waiting, sleeping, or otherwise occupied, and the thread is interrupted, either before or during the activity. 
InvalidPreferencesFormatException Thrown to indicate that an operation could not complete because the input did not conform to the appropriate XML document type for a collection of preferences, as per the Preferences specification. 
IsolatedServiceException A class that an IsolatedService can use to signal a failure in handling a request and return an error to be logged and aggregated. 
JSONException Thrown to indicate a problem with the JSON API. 
KeyChainException Thrown on problems accessing the KeyChain
KeyStoreException Exception containing information about the failure at the Keystore / KeyMint layer while generating or using a key. 
LambdaConversionException LambdaConversionException 
LastOwnerException This class was deprecated in API level 33. This class is deprecated and subject to removal in a future version of Java SE. It has been replaced by java.security.Policy and related classes since 1.2. 
LoadSdkException Exception thrown by SdkSandboxManager#loadSdk 
MediaCasException Base class for MediaCas exceptions 
MediaCryptoException Exception thrown if MediaCrypto object could not be instantiated or if unable to perform an operation on the MediaCrypto object. 
MediaDrmException Base class for MediaDrm exceptions 
NotOwnerException This class was deprecated in API level 33. This class is deprecated and subject to removal in a future version of Java SE. It has been replaced by java.security.Policy and related classes since 1.2. 
OnDevicePersonalizationException Exception thrown by OnDevicePersonalization APIs. 
OperationApplicationException Thrown when an application of a ContentProviderOperation fails due the specified constraints. 
ParseException Signals that an error has been reached unexpectedly while parsing. 
ParserConfigurationException Indicates a serious configuration error. 
PrivilegedActionException Legacy security code; do not use. 
ReflectiveOperationException Common superclass of exceptions thrown by reflective operations in core reflection. 
RequestSurfacePackageException This class was deprecated in API level 36. Exception is used at SdkSandboxManager#requestSurfacePackage which is getting deprecated. 
RuntimeException RuntimeException is the superclass of those exceptions that can be thrown during the normal operation of the Java Virtual Machine. 
SAXException Encapsulate a general SAX error or warning. 
SQLException

An exception that provides information on a database access error or other errors. 

SipException This class was deprecated in API level 31. SipManager and associated classes are no longer supported and should not be used as the basis of future VOIP apps. 
SurfaceTexture.OutOfResourcesException This class was deprecated in API level 19. No longer thrown. Surface.OutOfResourcesException is used instead. 
TelephonyManager.CallComposerException Exception that may be supplied to the callback in TelephonyManager.uploadCallComposerPicture(InputStream, String, Executor, OutcomeReceiver) if something goes awry. 
TelephonyManager.NetworkSlicingException Exception that may be supplied to the callback in TelephonyManager.getNetworkSlicingConfiguration(Executor, OutcomeReceiver) if something goes awry. 
TimeoutException Exception thrown when a blocking operation times out. 
TooManyListenersException

The TooManyListenersException Exception is used as part of the Java Event model to annotate and implement a unicast special case of a multicast Event Source. 

TransformerException This class specifies an exceptional condition that occurred during the transformation process. 
URISyntaxException Checked exception thrown to indicate that a string could not be parsed as a URI reference. 
UnsupportedCallbackException Signals that a CallbackHandler does not recognize a particular Callback
XPathException XPathException represents a generic XPath exception. 
XmlPullParserException This exception is thrown to signal XML Pull Parser related faults. 
AEADBadTagException This exception is thrown when a Cipher operating in an AEAD mode (such as GCM/CCM) is unable to verify the supplied authentication tag. 
AcceptPendingException Unchecked exception thrown when an attempt is made to initiate an accept operation on a channel and a previous accept operation has not completed. 
AccessControlException

This exception is thrown by the AccessController to indicate that a requested access (to a critical system resource such as the file system or the network) is denied. 

AccessDeniedException Checked exception thrown when a file system operation is denied, typically due to a file permission or other access check. 
ActivityNotFoundException This exception is thrown when a call to Context#startActivity or one of its variants fails because an Activity can not be found to execute the given Intent. 
AlreadyBoundException Unchecked exception thrown when an attempt is made to bind the socket a network oriented channel that is already bound. 
AlreadyConnectedException Unchecked exception thrown when an attempt is made to connect a SocketChannel that is already connected. 
AlreadyPersonalizedException Thrown if trying to create a credential which already exists. 
AndroidRuntimeException Base class for all unchecked exceptions thrown by the Android frameworks. 
AnnotationTypeMismatchException Thrown to indicate that a program has attempted to access an element of an annotation whose type has changed after the annotation was compiled (or serialized). 
ArithmeticException Thrown when an exceptional arithmetic condition has occurred. 
ArrayIndexOutOfBoundsException Thrown to indicate that an array has been accessed with an illegal index. 
ArrayStoreException Thrown to indicate that an attempt has been made to store the wrong type of object into an array of objects. 
AsynchronousCloseException Checked exception received by a thread when another thread closes the channel or the part of the channel upon which it is blocked in an I/O operation. 
AtomicMoveNotSupportedException Checked exception thrown when a file cannot be moved as an atomic file system operation. 
AuthenticationRequiredException Specialization of SecurityException that is thrown when authentication is needed from the end user before viewing the content. 
AuthenticatorException  
BackendBusyException Indicates a transient error that prevented a key operation from being created. 
BackgroundServiceStartNotAllowedException Exception thrown when an app tries to start a background Service when it's not allowed to do so. 
BadPaddingException This exception is thrown when a particular padding mechanism is expected for the input data but the data is not padded properly. 
BadParcelableException Exception thrown when a Parcelable is malformed or otherwise invalid. 
Base64DataException This exception is thrown by Base64InputStream or Base64OutputStream when an error is detected in the data being decoded. 
BatchUpdateException The subclass of SQLException thrown when an error occurs during a batch update operation. 
BindException Signals that an error occurred while attempting to bind a socket to a local address and port. 
BluetoothSocketException Thrown when an error occurs during a Bluetooth Socket related exception. 
BufferOverflowException Unchecked exception thrown when a relative put operation reaches the target buffer's limit. 
BufferUnderflowException Unchecked exception thrown when a relative get operation reaches the source buffer's limit. 
CRLException CRL (Certificate Revocation List) Exception. 
CallEndpointException This class represents a set of exceptions that can occur when requesting a CallEndpoint change. 
CallException This class defines exceptions that can be thrown when using Telecom APIs with OutcomeReceivers. 
CallbackException Exception passed to UrlRequest.Callback.onFailed() when UrlRequest.Callback or UploadDataProvider method throws an exception. 
CameraAccessException

CameraAccessException is thrown if a camera device could not be queried or opened by the CameraManager, or if the connection to an opened CameraDevice is no longer valid. 

CancellationException Exception indicating that the result of a value-producing task, such as a FutureTask, cannot be retrieved because the task was cancelled. 
CancelledKeyException Unchecked exception thrown when an attempt is made to use a selection key that is no longer valid. 
CertPathBuilderException An exception indicating one of a variety of problems encountered when building a certification path with a CertPathBuilder
CertPathValidatorException An exception indicating one of a variety of problems encountered when validating a certification path. 
CertStoreException An exception indicating one of a variety of problems retrieving certificates and CRLs from a CertStore
CertificateEncodingException Certificate Encoding Exception. 
CertificateException This exception indicates one of a variety of certificate problems. 
CertificateExpiredException Certificate Expired Exception. 
CertificateNotYetValidException Certificate is not yet valid exception. 
CertificateParsingException Certificate Parsing Exception. 
CertificateRevokedException An exception that indicates an X.509 certificate is revoked. 
CharConversionException Base class for character conversion exceptions. 
CharacterCodingException Checked exception thrown when a character encoding or decoding error occurs. 
CipherSuiteNotSupportedException Thrown if trying to use a cipher suite which isn't supported. 
ClassCastException Thrown to indicate that the code has attempted to cast an object to a subclass of which it is not an instance. 
ClassNotFoundException Thrown when an application tries to load in a class through its string name using:
  • The forName method in class Class
ClosedByInterruptException Checked exception received by a thread when another thread interrupts it while it is blocked in an I/O operation upon a channel. 
ClosedChannelException Checked exception thrown when an attempt is made to invoke or complete an I/O operation upon channel that is closed, or at least closed to that operation. 
ClosedDirectoryStreamException Unchecked exception thrown when an attempt is made to invoke an operation on a directory stream that is closed. 
ClosedFileSystemException Unchecked exception thrown when an attempt is made to invoke an operation on a file and the file system is closed. 
ClosedSelectorException Unchecked exception thrown when an attempt is made to invoke an I/O operation upon a closed selector. 
ClosedWatchServiceException Unchecked exception thrown when an attempt is made to invoke an operation on a watch service that is closed. 
CompanionException CompanionException can be thrown during the companion system data transfer process. 
CompletionException Exception thrown when an error or other exception is encountered in the course of completing a result or task. 
ConcurrentModificationException This exception may be thrown by methods that have detected concurrent modification of an object when such modification is not permissible. 
ConnectException Signals that an error occurred while attempting to connect a socket to a remote address and port. 
ConnectTimeoutException This class was deprecated in API level 22. Please use URL.openConnection() instead. Please visit this webpage for further details. 
ConnectionPendingException Unchecked exception thrown when an attempt is made to connect a SocketChannel for which a non-blocking connection operation is already in progress. 
CursorIndexOutOfBoundsException An exception indicating that a cursor is out of bounds. 
CursorWindowAllocationException This exception is thrown when a CursorWindow couldn't be allocated, most probably due to memory not being available. 
DOMException DOM operations only raise exceptions in "exceptional" circumstances, i.e., when an operation is impossible to perform (either for logical reasons, because data is lost, or because the implementation has become unstable). 
DataTruncation An exception thrown as a DataTruncation exception (on writes) or reported as a DataTruncation warning (on reads) when a data values is unexpectedly truncated for reasons other than its having execeeded MaxFieldSize
DateTimeException Exception used to indicate a problem while calculating a date-time. 
DateTimeParseException An exception thrown when an error occurs during parsing. 
DeadObjectException The object you are calling has died, because its hosting process no longer exists, or there has been a low-level binder error. 
DeadSystemException The core Android system has died and is going through a runtime restart. 
DeniedByServerException Exception thrown when the provisioning server or key server denies a certficate or license for a device. 
DeviceNotAssociatedException An exception for a case when a given device was not associated to the calling app. 
DigestException This is the generic Message Digest exception. 
DirectoryIteratorException Runtime exception thrown if an I/O error is encountered when iterating over the entries in a directory. 
DirectoryNotEmptyException Checked exception thrown when a file system operation fails because a directory is not empty. 
DocTypeNotSupportedException Thrown if trying to create a credential with an unsupported document type. 
DuplicateFormatFlagsException Unchecked exception thrown when duplicate flags are provided in the format specifier. 
EOFException Signals that an end of file or end of stream has been reached unexpectedly during input. 
EmptyStackException Thrown by methods in the Stack class to indicate that the stack is empty. 
EnumConstantNotPresentException Thrown when an application tries to access an enum constant by name and the enum type contains no constant with the specified name. 
EphemeralPublicKeyNotFoundException Thrown if the ephemeral public key was not found in the session transcript passed to IdentityCredential#getEntries(byte[], Map, byte[], byte[])
ExemptionMechanismException This is the generic ExemptionMechanism exception. 
FileAlreadyExistsException Checked exception thrown when an attempt is made to create a file or directory and a file of that name already exists. 
FileLockInterruptionException Checked exception received by a thread when another thread interrupts it while it is waiting to acquire a file lock. 
FileNotFoundException Signals that an attempt to open the file denoted by a specified pathname has failed. 
FileSystemAlreadyExistsException Runtime exception thrown when an attempt is made to create a file system that already exists. 
FileSystemException Thrown when a file system operation fails on one or two files. 
FileSystemLoopException Checked exception thrown when a file system loop, or cycle, is encountered. 
FileSystemNotFoundException Runtime exception thrown when a file system cannot be found. 
FileUriExposedException The exception that is thrown when an application exposes a file:// Uri to another app. 
ForegroundServiceStartNotAllowedException Exception thrown when an app tries to start a foreground Service when it's not allowed to do so. 
ForegroundServiceTypeException Base exception thrown when an app tries to start a foreground Service without a valid type. 
FormatFlagsConversionMismatchException Unchecked exception thrown when a conversion and flag are incompatible. 
FormatterClosedException Unchecked exception thrown when the formatter has been closed. 
Fragment.InstantiationException This class was deprecated in API level 28. Use Fragment.InstantiationException 
GLException An exception class for OpenGL errors. 
HealthConnectException Class representing health connect exceptions. 
HttpException Base exception passed to UrlRequest.Callback.onFailed()
HttpRetryException Thrown to indicate that a HTTP request needs to be retried but cannot be retried automatically, due to streaming mode being enabled. 
ICUUncheckedIOException Unchecked version of IOException
IkeIOException Wrapper for I/O exceptions encountered during IKE operations. 
IkeInternalException IkeInternalException encapsulates all local implementation or resource related exceptions. 
IkeNetworkLostException IkeNetworkLostException is returned to the caller via IkeSessionCallback.onError(android.net.ipsec.ike.exceptions.IkeException) if the underlying Network for the IkeSession was lost with no alternatives. 
IkeNonProtocolException IkeNonProtocolException encapsulates all implementation-specific non-protocol IKE errors. 
IkeProtocolException IkeProtocolException is an abstract class that represents the common information for all IKE protocol errors. 
IkeTimeoutException This exception is thrown when there is an IKE retransmission timeout. 
IllegalAccessException An IllegalAccessException is thrown when an application tries to reflectively create an instance (other than an array), set or get a field, or invoke a method, but the currently executing method does not have access to the definition of the specified class, field, method or constructor. 
IllegalArgumentException Thrown to indicate that a method has been passed an illegal or inappropriate argument. 
IllegalBlockSizeException This exception is thrown when the length of data provided to a block cipher is incorrect, i.e., does not match the block size of the cipher. 
IllegalBlockingModeException Unchecked exception thrown when a blocking-mode-specific operation is invoked upon a channel in the incorrect blocking mode. 
IllegalChannelGroupException Unchecked exception thrown when an attempt is made to open a channel in a group that was not created by the same provider. 
IllegalCharsetNameException Unchecked exception thrown when a string that is not a legal charset name is used as such. 
IllegalFormatCodePointException Unchecked exception thrown when a character with an invalid Unicode code point as defined by Character#isValidCodePoint is passed to the Formatter
IllegalFormatConversionException Unchecked exception thrown when the argument corresponding to the format specifier is of an incompatible type. 
IllegalFormatException Unchecked exception thrown when a format string contains an illegal syntax or a format specifier that is incompatible with the given arguments. 
IllegalFormatFlagsException Unchecked exception thrown when an illegal combination flags is given. 
IllegalFormatPrecisionException Unchecked exception thrown when the precision is a negative value other than -1, the conversion does not support a precision, or the value is otherwise unsupported. 
IllegalFormatWidthException Unchecked exception thrown when the format width is a negative value other than -1 or is otherwise unsupported. 
IllegalMonitorStateException Thrown to indicate that a thread has attempted to wait on an object's monitor or to notify other threads waiting on an object's monitor without owning the specified monitor. 
IllegalSelectorException Unchecked exception thrown when an attempt is made to register a channel with a selector that was not created by the provider that created the channel. 
IllegalStateException Signals that a method has been invoked at an illegal or inappropriate time. 
IllegalThreadStateException Thrown to indicate that a thread is not in an appropriate state for the requested operation. 
IllformedLocaleException Thrown by methods in Locale and Locale.Builder to indicate that an argument is not a well-formed BCP 47 tag. 
ImageDecoder.DecodeException Information about an interrupted decode. 
IncompleteAnnotationException Thrown to indicate that a program has attempted to access an element of an annotation interface that was added to the annotation interface definition after the annotation was compiled (or serialized). 
IndexOutOfBoundsException Thrown to indicate that an index of some sort (such as to an array, to a string, or to a vector) is out of range. 
InflateException This exception is thrown by an inflater on error conditions. 
InlineExecutionProhibitedException Thrown when an executor runs a submitted runnable inline in Executor.execute(Runnable) and UrlRequest.Builder.setDirectExecutorAllowed(boolean) was not called. 
InputMismatchException Thrown by a Scanner to indicate that the token retrieved does not match the pattern for the expected type, or that the token is out of range for the expected type. 
InspectionCompanion.UninitializedPropertyMapException Thrown by InspectionCompanion.readProperties(java.lang.Object, android.view.inspector.PropertyReader) if called before InspectionCompanion.mapProperties(android.view.inspector.PropertyMapper)
InstantiationException Thrown when an application tries to create an instance of a class using the newInstance method in class Class, but the specified class object cannot be instantiated. 
IntentFilter.MalformedMimeTypeException This exception is thrown when a given MIME type does not have a valid syntax. 
IntentSender.SendIntentException Exception thrown when trying to send through a PendingIntent that has been canceled or is otherwise no longer able to execute the request. 
InterruptedByTimeoutException Checked exception received by a thread when a timeout elapses before an asynchronous operation completes. 
InterruptedIOException Signals that an I/O operation has been interrupted. 
InvalidAlgorithmParameterException This is the exception for invalid or inappropriate algorithm parameters. 
InvalidClassException Thrown when the Serialization runtime detects one of the following problems with a Class. 
InvalidForegroundServiceTypeException Exception thrown when an app tries to start a foreground Service with an invalid type. 
InvalidKeException This exception is thrown when the remote server expected a different Diffie-Hellman group. 
InvalidKeyException This is the exception for invalid Keys (invalid encoding, wrong length, uninitialized, etc). 
InvalidKeySpecException This is the exception for invalid key specifications. 
InvalidMajorVersionException This exception is thrown when major version of an inbound message is higher than 2. 
InvalidMarkException Unchecked exception thrown when an attempt is made to reset a buffer when its mark is not defined. 
InvalidObjectException Indicates that one or more deserialized objects failed validation tests. 
InvalidParameterException This exception, designed for use by the JCA/JCE engine classes, is thrown when an invalid parameter is passed to a method. 
InvalidParameterSpecException This is the exception for invalid parameter specifications. 
InvalidPathException Unchecked exception thrown when path string cannot be converted into a Path because the path string contains invalid characters, or the path string is invalid for other file system specific reasons. 
InvalidPropertiesFormatException Thrown to indicate that an operation could not complete because the input did not conform to the appropriate XML document type for a collection of properties, as per the Properties specification. 
InvalidReaderSignatureException Thrown if the reader signature is invalid, or it doesn't contain a certificate chain, or if the signature failed to validate. 
InvalidRequestMessageException Thrown if message with the request doesn't satisfy the requirements documented in IdentityCredential#getEntries(byte[], Map, byte[], byte[])
InvalidSelectorsException This exception is thrown if the remote server received an IPsec packet with mismatched selectors. 
InvocationTargetException InvocationTargetException is a checked exception that wraps an exception thrown by an invoked method or constructor. 
IpSecManager.ResourceUnavailableException Thrown to indicate that an IPsec resource is unavailable. 
IpSecManager.SpiUnavailableException Thrown to indicate that a requested SPI is in use. 
JarException Signals that an error of some sort has occurred while reading from or writing to a JAR file. 
KeyCharacterMap.UnavailableException Thrown by KeyCharacterMap#load when a key character map could not be loaded. 
KeyException This is the basic key exception. 
KeyExpiredException Indicates that a cryptographic operation failed because the employed key's validity end date is in the past. 
KeyManagementException This is the general key management exception for all operations dealing with key management. 
KeyNotYetValidException Indicates that a cryptographic operation failed because the employed key's validity start date is in the future. 
KeyPermanentlyInvalidatedException Indicates that the key can no longer be used because it has been permanently invalidated. 
KeyStoreException This is the generic KeyStore exception. 
LSException Parser or write operations may throw an LSException if the processing is stopped. 
LimitExceededException Indicates that the app has exceeded a limit set by the System. 
LoginException This is the basic login exception. 
MalformedInputException Checked exception thrown when an input byte sequence is not legal for given charset, or an input character sequence is not a legal sixteen-bit Unicode sequence. 
MalformedJsonException Thrown when a reader encounters malformed JSON. 
MalformedParameterizedTypeException Thrown when a semantically malformed parameterized type is encountered by a reflective method that needs to instantiate it. 
MalformedParametersException Thrown when the java.lang.reflect package attempts to read method parameters from a class file and determines that one or more parameters are malformed. 
MalformedURLException Thrown to indicate that a malformed URL has occurred. 
MediaCasException.DeniedByServerException Exception thrown when the provisioning server or key server denies a license for a device. 
MediaCasException.InsufficientResourceException Exception thrown when an operation on a MediaCas object is attempted and hardware resources are not sufficient to allocate, due to client's lower priority. 
MediaCasException.NotProvisionedException Exception thrown when an operation on a MediaCas object is attempted before it's provisioned successfully. 
MediaCasException.ResourceBusyException Exception thrown when an operation on a MediaCas object is attempted and hardware resources are not available, due to being in use. 
MediaCasException.UnsupportedCasException Exception thrown when an attempt is made to construct a MediaCas object using a CA_system_id that is not supported by the device 
MediaCasStateException Base class for MediaCas runtime exceptions 
MediaCodec.CodecException Thrown when an internal codec error occurs. 
MediaCodec.CryptoException Thrown when a crypto error occurs while queueing a secure input buffer. 
MediaCodec.IncompatibleWithBlockModelException Thrown when the codec is configured for block model and an incompatible API is called. 
MediaCodec.InvalidBufferFlagsException Thrown when a buffer is marked with an invalid combination of flags (e.g. both MediaCodec.BUFFER_FLAG_END_OF_STREAM and MediaCodec.BUFFER_FLAG_DECODE_ONLY
MediaDrm.MediaDrmStateException Thrown when a general failure occurs during a MediaDrm operation. 
MediaDrm.SessionException SessionException is a misnomer because it may occur in methods without a session context. 
MediaDrmResetException This exception is thrown when the MediaDrm instance has become unusable due to a restart of the mediaserver process. 
MediaParser.ParsingException Thrown when an error occurs while parsing a media stream. 
MediaParser.UnrecognizedInputFormatException Thrown if all parser implementations provided to MediaParser.create(OutputConsumer, String) failed to sniff the input content. 
MediaPlayer.NoDrmSchemeException Thrown when a DRM method is called before preparing a DRM scheme through prepareDrm(). 
MediaPlayer.ProvisioningNetworkErrorException Thrown when the device requires DRM provisioning but the provisioning attempt has failed due to a network error (Internet reachability, timeout, etc.). 
MediaPlayer.ProvisioningServerErrorException Thrown when the device requires DRM provisioning but the provisioning attempt has failed due to the provisioning server denying the request. 
MessageDecryptionException Thrown when failing to decrypt a message from the reader device. 
MissingForegroundServiceTypeException Exception thrown when an app tries to start a foreground Service without a type. 
MissingFormatArgumentException Unchecked exception thrown when there is a format specifier which does not have a corresponding argument or if an argument index refers to an argument that does not exist. 
MissingFormatWidthException Unchecked exception thrown when the format width is required. 
MissingResourceException Signals that a resource is missing. 
NegativeArraySizeException Thrown if an application tries to create an array with negative size. 
NetworkErrorException  
NetworkException Exception passed to UrlRequest.Callback.onFailed() when the HTTP stack fails to process a network request. 
NetworkOnMainThreadException The exception that is thrown when an application attempts to perform a networking operation on its main thread. 
NoAuthenticationKeyAvailableException Thrown if no dynamic authentication keys are available. 
NoConnectionPendingException Unchecked exception thrown when the finishConnect method of a SocketChannel is invoked without first successfully invoking its connect method. 
NoRouteToHostException Signals that an error occurred while attempting to connect a socket to a remote address and port. 
NoSuchAlgorithmException This exception is thrown when a particular cryptographic algorithm is requested but is not available in the environment. 
NoSuchElementException Thrown by various accessor methods to indicate that the element being requested does not exist. 
NoSuchFieldException Signals that the class doesn't have a field of a specified name. 
NoSuchFileException Checked exception thrown when an attempt is made to access a file that does not exist. 
NoSuchMethodException Thrown when a particular method cannot be found. 
NoSuchPaddingException This exception is thrown when a particular padding mechanism is requested but is not available in the environment. 
NoSuchPropertyException Thrown when code requests a Property on a class that does not expose the appropriate method or field. 
NoSuchProviderException This exception is thrown when a particular security provider is requested but is not available in the environment. 
NonReadableChannelException Unchecked exception thrown when an attempt is made to read from a channel that was not originally opened for reading. 
NonWritableChannelException Unchecked exception thrown when an attempt is made to write to a channel that was not originally opened for writing. 
NotActiveException Thrown when serialization or deserialization is not active. 
NotDirectoryException Checked exception thrown when a file system operation, intended for a directory, fails because the file is not a directory. 
NotLinkException Checked exception thrown when a file system operation fails because a file is not a symbolic link. 
NotProvisionedException Exception thrown when an operation on a MediaDrm object is attempted and the device does not have a certificate. 
NotSerializableException Thrown when an instance is required to have a Serializable interface. 
NotYetBoundException Unchecked exception thrown when an attempt is made to invoke an I/O operation upon a server socket channel that is not yet bound. 
NotYetConnectedException Unchecked exception thrown when an attempt is made to invoke an I/O operation upon a socket channel that is not yet connected. 
NullPointerException Thrown when an application attempts to use null in a case where an object is required. 
NumberFormatException Thrown to indicate that the application has attempted to convert a string to one of the numeric types, but that the string does not have the appropriate format. 
ObjectStreamException Superclass of all exceptions specific to Object Stream classes. 
OperationCanceledException  
OptionalDataException Exception indicating the failure of an object read operation due to unread primitive data, or the end of data belonging to a serialized object in the stream. 
OverlappingFileLockException Unchecked exception thrown when an attempt is made to acquire a lock on a region of a file that overlaps a region already locked by the same Java virtual machine, or when another thread is already waiting to lock an overlapping region of the same file. 
PackageManager.NameNotFoundException This exception is thrown when a given package, application, or component name cannot be found. 
ParcelFileDescriptor.FileDescriptorDetachedException Exception that indicates that the file descriptor was detached. 
ParcelFormatException The contents of a Parcel (usually during unmarshalling) does not contain the expected data. 
ParseException Thrown when parsing failed. 
PatternSyntaxException Unchecked exception thrown to indicate a syntax error in a regular-expression pattern. 
PendingIntent.CanceledException Exception thrown when trying to send through a PendingIntent that has been canceled or is otherwise no longer able to execute the request. 
PortUnreachableException Signals that an ICMP Port Unreachable message has been received on a connected datagram. 
PropertyMapper.PropertyConflictException Thrown from a map method if a property name is already mapped as different type. 
PropertyReader.PropertyTypeMismatchException Thrown if a client calls a typed read method for a property of a different type. 
ProtocolException Thrown to indicate that there is an error in the underlying protocol, such as a TCP error. 
ProviderException A runtime exception for Provider exceptions (such as misconfiguration errors or unrecoverable internal errors), which may be subclassed by Providers to throw specialized, provider-specific runtime errors. 
ProviderMismatchException Unchecked exception thrown when an attempt is made to invoke a method on an object created by one file system provider with a parameter created by a different file system provider. 
ProviderNotFoundException Runtime exception thrown when a provider of the required type cannot be found. 
QueryLocationException This class represents a set of exceptions that can occur when requesting a Connection#queryLocationForEmergency(long, String, Executor, OutcomeReceiver) 
QuicException Subclass of NetworkException which contains a detailed QUIC error code from QuicErrorCode
RSDriverException This class was deprecated in API level 31. Renderscript has been deprecated in API level 31. Please refer to the migration guide for the proposed alternatives. 
RSIllegalArgumentException This class was deprecated in API level 31. Renderscript has been deprecated in API level 31. Please refer to the migration guide for the proposed alternatives. 
RSInvalidStateException This class was deprecated in API level 31. Renderscript has been deprecated in API level 31. Please refer to the migration guide for the proposed alternatives. 
RSRuntimeException This class was deprecated in API level 31. Renderscript has been deprecated in API level 31. Please refer to the migration guide for the proposed alternatives. 
ReadOnlyBufferException Unchecked exception thrown when a content-mutation method such as put or compact is invoked upon a read-only buffer. 
ReadOnlyFileSystemException Unchecked exception thrown when an attempt is made to update an object associated with a read-only FileSystem
ReadPendingException Unchecked exception thrown when an attempt is made to read from an asynchronous socket channel and a previous read has not completed. 
ReceiverCallNotAllowedException This exception is thrown from Context#registerReceiver and Context#bindService when these methods are being used from an BroadcastReceiver component. 
RecoverableSecurityException Specialization of SecurityException that contains additional information about how to involve the end user to recover from the exception. 
RejectedExecutionException Exception thrown by an Executor when a task cannot be accepted for execution. 
RemoteException Parent exception for all Binder remote-invocation errors Note: not all exceptions from binder services will be subclasses of this. 
RemoteViews.ActionException Exception to send when something goes wrong executing an action 
ResourceBusyException Exception thrown when an operation on a MediaDrm object is attempted and hardware resources are not available, due to being in use. 
Resources.NotFoundException This exception is thrown by the resource APIs when a requested resource can not be found. 
SAXNotRecognizedException Exception class for an unrecognized identifier. 
SAXNotSupportedException Exception class for an unsupported operation. 
SAXParseException Encapsulate an XML parse error or warning. 
SQLClientInfoException The subclass of SQLException is thrown when one or more client info properties could not be set on a Connection
SQLDataException The subclass of SQLException thrown when the SQLState class value is '22', or under vendor-specified conditions. 
SQLException An exception that indicates there was an error with SQL parsing or execution. 
SQLFeatureNotSupportedException The subclass of SQLException thrown when the SQLState class value is '0A' ( the value is 'zero' A). 
SQLIntegrityConstraintViolationException The subclass of SQLException thrown when the SQLState class value is '23', or under vendor-specified conditions. 
SQLInvalidAuthorizationSpecException The subclass of SQLException thrown when the SQLState class value is '28', or under vendor-specified conditions. 
SQLNonTransientConnectionException The subclass of SQLException thrown for the SQLState class value '08', or under vendor-specified conditions. 
SQLNonTransientException The subclass of SQLException thrown when an instance where a retry of the same operation would fail unless the cause of the SQLException is corrected. 
SQLRecoverableException The subclass of SQLException thrown in situations where a previously failed operation might be able to succeed if the application performs some recovery steps and retries the entire transaction or in the case of a distributed transaction, the transaction branch. 
SQLSyntaxErrorException The subclass of SQLException thrown when the SQLState class value is '42', or under vendor-specified conditions. 
SQLTimeoutException

The subclass of SQLException thrown when the timeout specified by Statement has expired. 

SQLTransactionRollbackException The subclass of SQLException thrown when the SQLState class value is '40', or under vendor-specified conditions. 
SQLTransientConnectionException The subclass of SQLException for the SQLState class value '08', or under vendor-specified conditions. 
SQLTransientException The subclass of SQLException is thrown in situations where a previoulsy failed operation might be able to succeed when the operation is retried without any intervention by application-level functionality. 
SQLWarning

An exception that provides information on database access warnings. 

SQLiteAbortException An exception that indicates that the SQLite program was aborted. 
SQLiteAccessPermException This exception class is used when sqlite can't access the database file due to lack of permissions on the file. 
SQLiteBindOrColumnIndexOutOfRangeException Thrown if the bind or column parameter index is out of range. 
SQLiteBlobTooBigException  
SQLiteCantOpenDatabaseException  
SQLiteConstraintException An exception that indicates that an integrity constraint was violated. 
SQLiteDatabaseCorruptException An exception that indicates that the SQLite database file is corrupt. 
SQLiteDatabaseLockedException Thrown if the database engine was unable to acquire the database locks it needs to do its job. 
SQLiteDatatypeMismatchException  
SQLiteDiskIOException Indicates that an IO error occurred while accessing the SQLite database file. 
SQLiteDoneException An exception that indicates that the SQLite program is done. 
SQLiteException A SQLite exception that indicates there was an error with SQL parsing or execution. 
SQLiteFullException An exception that indicates that the SQLite database is full. 
SQLiteMisuseException This error can occur if the application creates a SQLiteStatement object and allows multiple threads in the application use it at the same time. 
SQLiteOutOfMemoryException  
SQLiteReadOnlyDatabaseException  
SQLiteTableLockedException  
SSLException Indicates some kind of error detected by an SSL subsystem. 
SSLHandshakeException Indicates that the client and server could not negotiate the desired level of security. 
SSLKeyException Reports a bad SSL key. 
SSLPeerUnverifiedException Indicates that the peer's identity has not been verified. 
SSLProtocolException Reports an error in the operation of the SSL protocol. 
SecureKeyImportUnavailableException Indicates that the Keystore does not support securely importing wrapped keys. 
SecurityException Thrown by the security manager to indicate a security violation. 
ServiceStartNotAllowedException Exception thrown when an app tries to start a Service when it's not allowed to do so. 
SessionTranscriptMismatchException Thrown when trying use multiple different session transcripts in the same presentation session. 
Settings.SettingNotFoundException  
ShortBufferException This exception is thrown when an output buffer provided by the user is too short to hold the operation result. 
ShutdownChannelGroupException Unchecked exception thrown when an attempt is made to construct a channel in a group that is shutdown or the completion handler for an I/O operation cannot be invoked because the channel group has terminated. 
SignatureException This is the generic Signature exception. 
SocketException Thrown to indicate that there is an error creating or accessing a Socket. 
SocketTimeoutException Signals that a timeout has occurred on a socket read or accept. 
StaleDataException This exception is thrown when a Cursor contains stale data and must be requeried before being used again. 
StartForegroundCalledOnStoppedServiceException Exception thrown when Service#startForeground is called on a service that's not actually started. 
StreamCorruptedException Thrown when control information that was read from an object stream violates internal consistency checks. 
StringIndexOutOfBoundsException Thrown by String methods to indicate that an index is either negative or greater than the size of the string. 
StringPrepParseException Exception that signals an error has occurred while parsing the input to StringPrep or IDNA. 
StrongBoxUnavailableException Indicates that an operation could not be performed because the requested security hardware is not available. 
Surface.OutOfResourcesException Exception thrown when a Canvas couldn't be locked with Surface#lockCanvas, or when a SurfaceTexture could not successfully be allocated. 
SurfaceHolder.BadSurfaceTypeException Exception that is thrown from SurfaceHolder.lockCanvas() when called on a Surface whose type is SURFACE_TYPE_PUSH_BUFFERS. 
SyncFailedException Signals that a sync operation has failed. 
SystemUpdatePolicy.ValidationFailedException An exception class that represents various validation errors thrown from SystemUpdatePolicy#setFreezePeriods and DevicePolicyManager#setSystemUpdatePolicy 
TagLostException  
TelephonyManager.ModemErrorException Exception that is supplied to the callback in TelephonyManager.getNetworkSlicingConfiguration(Executor, OutcomeReceiver) if the modem returned a failure. 
TelephonyManager.TimeoutException Exception that is supplied to the callback in TelephonyManager.getNetworkSlicingConfiguration(Executor, OutcomeReceiver) if the system timed out waiting for a response from the Radio. 
TimeFormatException  
TransactionTooLargeException The Binder transaction failed because it was too large. 
TransformerConfigurationException Indicates a serious configuration error. 
TypeNotPresentException Thrown when an application tries to access a type using a string representing the type's name, but no definition for the type with the specified name can be found. 
UTFDataFormatException Signals that a malformed string in modified UTF-8 format has been read in a data input stream or by any class that implements the data input interface. 
UncheckedIOException Wraps an IOException with an unchecked exception. 
UndeclaredThrowableException Thrown by a method invocation on a proxy instance if its invocation handler's invoke method throws a checked exception (a Throwable that is not assignable to RuntimeException or Error) that is not assignable to any of the exception types declared in the throws clause of the method that was invoked on the proxy instance and dispatched to the invocation handler. 
UnknownAuthenticationKeyException Thrown if trying to certify an unknown dynamic authentication key. 
UnknownFormatConversionException Unchecked exception thrown when an unknown conversion is given. 
UnknownFormatFlagsException Unchecked exception thrown when an unknown flag is given. 
UnknownHostException Thrown to indicate that the IP address of a host could not be determined. 
UnknownServiceException Thrown to indicate that an unknown service exception has occurred. 
UnmappableCharacterException Checked exception thrown when an input character (or byte) sequence is valid but cannot be mapped to an output byte (or character) sequence. 
UnrecoverableEntryException This exception is thrown if an entry in the keystore cannot be recovered. 
UnrecoverableKeyException This exception is thrown if a key in the keystore cannot be recovered. 
UnresolvedAddressException Unchecked exception thrown when an attempt is made to invoke a network operation upon an unresolved socket address. 
UnsafeStateException Exception thrown when a DevicePolicyManager operation failed because it was not safe to be executed at that moment. 
UnsupportedAddressTypeException Unchecked exception thrown when an attempt is made to bind or connect to a socket address of a type that is not supported. 
UnsupportedCharsetException Unchecked exception thrown when no support is available for a requested charset. 
UnsupportedEncodingException The Character Encoding is not supported. 
UnsupportedOperationException Thrown to indicate that the requested operation is not supported. 
UnsupportedSchemeException Exception thrown when an attempt is made to construct a MediaDrm object using a crypto scheme UUID that is not supported by the device 
UnsupportedTemporalTypeException UnsupportedTemporalTypeException indicates that a ChronoField or ChronoUnit is not supported for a Temporal class. 
UserManager.UserOperationException Thrown to indicate user operation failed. 
UserNotAuthenticatedException Indicates that a cryptographic operation could not be performed because the user has not been authenticated recently enough. 
UserPresenceUnavailableException Indicates the condition that a proof of user-presence was requested but this proof was not presented. 
UserPrincipalNotFoundException Checked exception thrown when a lookup of UserPrincipal fails because the principal does not exist. 
WindowManager.BadTokenException Exception that is thrown when trying to add view whose LayoutParams LayoutParams#token is invalid. 
WindowManager.InvalidDisplayException Exception that is thrown when calling ViewManager.addView(View, LayoutParams) to a secondary display that cannot be found. 
WriteAbortedException Signals that one of the ObjectStreamExceptions was thrown during a write operation. 
WritePendingException Unchecked exception thrown when an attempt is made to write to an asynchronous socket channel and a previous write has not completed. 
WrongMethodTypeException Thrown to indicate that code has attempted to call a method handle via the wrong method type. 
XPathExpressionException XPathExpressionException represents an error in an XPath expression. 
XPathFactoryConfigurationException XPathFactoryConfigurationException represents a configuration error in a XPathFactory environment. 
XPathFunctionException XPathFunctionException represents an error with an XPath function. 
ZipException Signals that a Zip exception of some sort has occurred. 
ZoneRulesException Thrown to indicate a problem with time-zone configuration. 


The class Exception and its subclasses are a form of Throwable that indicates conditions that a reasonable application might want to catch.

The class Exception and any subclasses that are not also subclasses of RuntimeException are checked exceptions. Checked exceptions need to be declared in a method or constructor's throws clause if they can be thrown by the execution of the method or constructor and propagate outside the method or constructor boundary.

See also:

Summary

Public constructors

Exception()

Constructs a new exception with null as its detail message.

Exception(String message)

Constructs a new exception with the specified detail message.

Exception(String message, Throwable cause)

Constructs a new exception with the specified detail message and cause.

Exception(Throwable cause)

Constructs a new exception with the specified cause and a detail message of (cause==null ? null : cause.toString()) (which typically contains the class and detail message of cause).

Protected constructors

Exception(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace)

Constructs a new exception with the specified detail message, cause, suppression enabled or disabled, and writable stack trace enabled or disabled.

Inherited methods

final void addSuppressed(Throwable exception)

Appends the specified exception to the exceptions that were suppressed in order to deliver this exception.

Throwable fillInStackTrace()

Fills in the execution stack trace.

Throwable getCause()

Returns the cause of this throwable or null if the cause is nonexistent or unknown.

String getLocalizedMessage()

Creates a localized description of this throwable.

String getMessage()

Returns the detail message string of this throwable.

StackTraceElement[] getStackTrace()

Provides programmatic access to the stack trace information printed by printStackTrace().

final Throwable[] getSuppressed()

Returns an array containing all of the exceptions that were suppressed, typically by the try-with-resources statement, in order to deliver this exception.

Throwable initCause(Throwable cause)

Initializes the cause of this throwable to the specified value.

void printStackTrace()

Prints this throwable and its backtrace to the standard error stream.

void printStackTrace(PrintWriter s)

Prints this throwable and its backtrace to the specified print writer.

void printStackTrace(PrintStream s)

Prints this throwable and its backtrace to the specified print stream.

void setStackTrace(StackTraceElement[] stackTrace)

Sets the stack trace elements that will be returned by getStackTrace() and printed by printStackTrace() and related methods.

String toString()

Returns a short description of this throwable.

Object clone()

Creates and returns a copy of this object.

boolean equals(Object obj)

Indicates whether some other object is "equal to" this one.

void finalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

final Class<?> getClass()

Returns the runtime class of this Object.

int hashCode()

Returns a hash code value for the object.

final void notify()

Wakes up a single thread that is waiting on this object's monitor.

final void notifyAll()

Wakes up all threads that are waiting on this object's monitor.

String toString()

Returns a string representation of the object.

final void wait(long timeoutMillis, int nanos)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait(long timeoutMillis)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait()

Causes the current thread to wait until it is awakened, typically by being notified or interrupted.

Public constructors

Exception

Added in API level 1
public Exception ()

Constructs a new exception with null as its detail message. The cause is not initialized, and may subsequently be initialized by a call to Throwable.initCause(Throwable).

Exception

Added in API level 1
public Exception (String message)

Constructs a new exception with the specified detail message. The cause is not initialized, and may subsequently be initialized by a call to Throwable.initCause(Throwable).

Parameters
message String: the detail message. The detail message is saved for later retrieval by the Throwable.getMessage() method.

Exception

Added in API level 1
public Exception (String message, 
                Throwable cause)

Constructs a new exception with the specified detail message and cause.

Note that the detail message associated with cause is not automatically incorporated in this exception's detail message.

Parameters
message String: the detail message (which is saved for later retrieval by the Throwable.getMessage() method).

cause Throwable: the cause (which is saved for later retrieval by the Throwable.getCause() method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)

Exception

Added in API level 1
public Exception (Throwable cause)

Constructs a new exception with the specified cause and a detail message of (cause==null ? null : cause.toString()) (which typically contains the class and detail message of cause). This constructor is useful for exceptions that are little more than wrappers for other throwables (for example, PrivilegedActionException).

Parameters
cause Throwable: the cause (which is saved for later retrieval by the Throwable.getCause() method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)

Protected constructors

Exception

Added in API level 24
protected Exception (String message, 
                Throwable cause, 
                boolean enableSuppression, 
                boolean writableStackTrace)

Constructs a new exception with the specified detail message, cause, suppression enabled or disabled, and writable stack trace enabled or disabled.

Parameters
message String: the detail message.

cause Throwable: the cause. (A null value is permitted, and indicates that the cause is nonexistent or unknown.)

enableSuppression boolean: whether or not suppression is enabled or disabled

writableStackTrace boolean: whether or not the stack trace should be writable