# Throwable

public class **Throwable** extends NSException  
implements [Serializable](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/Serializable.html)

|---|---|---|
| Known Direct Subclasses [Error](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Error.html), [Exception](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Exception.html) |---|---| | [Error](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Error.html) | An `Error` is a subclass of `Throwable` that indicates serious problems that a reasonable application should not try to catch. | | [Exception](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Exception.html) | The class `Exception` and its subclasses are a form of `Throwable` that indicates conditions that a reasonable application might want to catch. | |||

|---|---|---|
| Known Indirect Subclasses [AEADBadTagException](https://developers.google.com/j2objc/javadoc/jre/reference/javax/crypto/AEADBadTagException.html), [AbstractMethodError](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/AbstractMethodError.html), [AcceptPendingException](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/channels/AcceptPendingException.html), [AccessControlException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/AccessControlException.html), [AccessDeniedException](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/AccessDeniedException.html), [AlreadyBoundException](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/channels/AlreadyBoundException.html), [AlreadyConnectedException](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/channels/AlreadyConnectedException.html), [AnnotationFormatError](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/annotation/AnnotationFormatError.html), [AnnotationTypeMismatchException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/annotation/AnnotationTypeMismatchException.html), [ArithmeticException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ArithmeticException.html), [ArrayIndexOutOfBoundsException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ArrayIndexOutOfBoundsException.html), [ArrayStoreException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ArrayStoreException.html), [AssertionError](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/AssertionError.html), [AsynchronousCloseException](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/channels/AsynchronousCloseException.html), [AtomicMoveNotSupportedException](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/AtomicMoveNotSupportedException.html), and [237 others.](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable#) |---|---| | [AEADBadTagException](https://developers.google.com/j2objc/javadoc/jre/reference/javax/crypto/AEADBadTagException.html) | This exception is thrown when a `https://developers.google.com/j2objc/javadoc/jre/reference/javax/crypto/Cipher.html` operating in an AEAD mode (such as GCM/CCM) is unable to verify the supplied authentication tag. | | [AbstractMethodError](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/AbstractMethodError.html) | Thrown when an application tries to call an abstract method. | | [AcceptPendingException](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/channels/AcceptPendingException.html) | 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](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/AccessControlException.html) | 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](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/AccessDeniedException.html) | Checked exception thrown when a file system operation is denied, typically due to a file permission or other access check. | | [AlreadyBoundException](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/channels/AlreadyBoundException.html) | Unchecked exception thrown when an attempt is made to bind the socket a network oriented channel that is already bound. | | [AlreadyConnectedException](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/channels/AlreadyConnectedException.html) | Unchecked exception thrown when an attempt is made to connect a `https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/channels/SocketChannel.html` that is already connected. | | [AnnotationFormatError](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/annotation/AnnotationFormatError.html) | Thrown when the annotation parser attempts to read an annotation from a class file and determines that the annotation is malformed. | | [AnnotationTypeMismatchException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/annotation/AnnotationTypeMismatchException.html) | 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](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ArithmeticException.html) | Thrown when an exceptional arithmetic condition has occurred. | | [ArrayIndexOutOfBoundsException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ArrayIndexOutOfBoundsException.html) | Thrown to indicate that an array has been accessed with an illegal index. | | [ArrayStoreException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ArrayStoreException.html) | Thrown to indicate that an attempt has been made to store the wrong type of object into an array of objects. | | [AssertionError](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/AssertionError.html) | Thrown to indicate that an assertion has failed. | | [AsynchronousCloseException](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/channels/AsynchronousCloseException.html) | 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](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/AtomicMoveNotSupportedException.html) | Checked exception thrown when a file cannot be moved as an atomic file system operation. | | [BadPaddingException](https://developers.google.com/j2objc/javadoc/jre/reference/javax/crypto/BadPaddingException.html) | This exception is thrown when a particular padding mechanism is expected for the input data but the data is not padded properly. | | [BatchUpdateException](https://developers.google.com/j2objc/javadoc/jre/reference/java/sql/BatchUpdateException.html) | The subclass of `https://developers.google.com/j2objc/javadoc/jre/reference/java/sql/SQLException.html` thrown when an error occurs during a batch update operation. | | [BindException](https://developers.google.com/j2objc/javadoc/jre/reference/java/net/BindException.html) | Signals that an error occurred while attempting to bind a socket to a local address and port. | | [BrokenBarrierException](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/concurrent/BrokenBarrierException.html) | 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. | | [BufferOverflowException](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/BufferOverflowException.html) | Unchecked exception thrown when a relative *put* operation reaches the target buffer's limit. | | [BufferUnderflowException](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/BufferUnderflowException.html) | Unchecked exception thrown when a relative *get* operation reaches the source buffer's limit. | | [CRLException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/CRLException.html) | CRL (Certificate Revocation List) Exception. | | [CancellationException](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/concurrent/CancellationException.html) | Exception indicating that the result of a value-producing task, such as a `https://developers.google.com/j2objc/javadoc/jre/reference/java/util/concurrent/FutureTask.html`, cannot be retrieved because the task was cancelled. | | [CancelledKeyException](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/channels/CancelledKeyException.html) | Unchecked exception thrown when an attempt is made to use a selection key that is no longer valid. | | [CertPathBuilderException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/CertPathBuilderException.html) | An exception indicating one of a variety of problems encountered when building a certification path with a `CertPathBuilder`. | | [CertPathValidatorException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/CertPathValidatorException.html) | An exception indicating one of a variety of problems encountered when validating a certification path. | | [CertStoreException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/CertStoreException.html) | An exception indicating one of a variety of problems retrieving certificates and CRLs from a `CertStore`. | | [CertificateEncodingException](https://developers.google.com/j2objc/javadoc/jre/reference/javax/security/cert/CertificateEncodingException.html) | Certificate Encoding Exception. | | [CertificateException](https://developers.google.com/j2objc/javadoc/jre/reference/javax/security/cert/CertificateException.html) | This exception indicates one of a variety of certificate problems. | | [CertificateExpiredException](https://developers.google.com/j2objc/javadoc/jre/reference/javax/security/cert/CertificateExpiredException.html) | Certificate Expired Exception. | | [CertificateNotYetValidException](https://developers.google.com/j2objc/javadoc/jre/reference/javax/security/cert/CertificateNotYetValidException.html) | Certificate is not yet valid exception. | | [CertificateParsingException](https://developers.google.com/j2objc/javadoc/jre/reference/javax/security/cert/CertificateParsingException.html) | Certificate Parsing Exception. | | [CertificateRevokedException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/cert/CertificateRevokedException.html) | An exception that indicates an X.509 certificate is revoked. | | [CharConversionException](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/CharConversionException.html) | Base class for character conversion exceptions. | | [CharacterCodingException](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/charset/CharacterCodingException.html) | Checked exception thrown when a character encoding or decoding error occurs. | | [ClassCastException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ClassCastException.html) | Thrown to indicate that the code has attempted to cast an object to a subclass of which it is not an instance. | | [ClassCircularityError](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ClassCircularityError.html) | Thrown when the Java Virtual Machine detects a circularity in the superclass hierarchy of a class being loaded. | | [ClassFormatError](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ClassFormatError.html) | Thrown when the Java Virtual Machine attempts to read a class file and determines that the file is malformed or otherwise cannot be interpreted as a class file. | | [ClassNotFoundException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ClassNotFoundException.html) | Thrown when an application tries to load in a class through its string name using: - The `forName` method in class `Class`. | | [CloneNotSupportedException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/CloneNotSupportedException.html) | 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. | | [ClosedByInterruptException](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/channels/ClosedByInterruptException.html) | Checked exception received by a thread when another thread interrupts it while it is blocked in an I/O operation upon a channel. | | [ClosedChannelException](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/channels/ClosedChannelException.html) | 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](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/ClosedDirectoryStreamException.html) | Unchecked exception thrown when an attempt is made to invoke an operation on a directory stream that is closed. | | [ClosedFileSystemException](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/ClosedFileSystemException.html) | Unchecked exception thrown when an attempt is made to invoke an operation on a file and the file system is closed. | | [ClosedSelectorException](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/channels/ClosedSelectorException.html) | Unchecked exception thrown when an attempt is made to invoke an I/O operation upon a closed selector. | | [ClosedWatchServiceException](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/ClosedWatchServiceException.html) | Unchecked exception thrown when an attempt is made to invoke an operation on a watch service that is closed. | | [CoderMalfunctionError](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/charset/CoderMalfunctionError.html) | Error thrown when the `https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/charset/CharsetDecoder.html#decodeLoop(java.nio.ByteBuffer,%20java.nio.CharBuffer)` method of a `https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/charset/CharsetDecoder.html`, or the `https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/charset/CharsetEncoder.html#encodeLoop(java.nio.CharBuffer,%20java.nio.ByteBuffer)` method of a `https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/charset/CharsetEncoder.html`, throws an unexpected exception. | | [CompletionException](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/concurrent/CompletionException.html) | Exception thrown when an error or other exception is encountered in the course of completing a result or task. | | [ConcurrentModificationException](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/ConcurrentModificationException.html) | This exception may be thrown by methods that have detected concurrent modification of an object when such modification is not permissible. | | [ConnectException](https://developers.google.com/j2objc/javadoc/jre/reference/java/net/ConnectException.html) | Signals that an error occurred while attempting to connect a socket to a remote address and port. | | [ConnectionPendingException](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/channels/ConnectionPendingException.html) | Unchecked exception thrown when an attempt is made to connect a `https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/channels/SocketChannel.html` for which a non-blocking connection operation is already in progress. | | [DOMException](https://developers.google.com/j2objc/javadoc/jre/reference/org/w3c/dom/DOMException.html) | 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). | | [DataFormatException](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/DataFormatException.html) | Signals that a data format error has occurred. | | [DataTruncation](https://developers.google.com/j2objc/javadoc/jre/reference/java/sql/DataTruncation.html) | 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`. | | [DatatypeConfigurationException](https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/datatype/DatatypeConfigurationException.html) | Indicates a serious configuration error. | | [DateTimeException](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/DateTimeException.html) | Exception used to indicate a problem while calculating a date-time. | | [DateTimeParseException](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/format/DateTimeParseException.html) | An exception thrown when an error occurs during parsing. | | [DestroyFailedException](https://developers.google.com/j2objc/javadoc/jre/reference/javax/security/auth/DestroyFailedException.html) | Signals that a `destroy` operation failed. | | [DigestException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/DigestException.html) | This is the generic Message Digest exception. | | [DirectoryIteratorException](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/DirectoryIteratorException.html) | Runtime exception thrown if an I/O error is encountered when iterating over the entries in a directory. | | [DirectoryNotEmptyException](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/DirectoryNotEmptyException.html) | Checked exception thrown when a file system operation fails because a directory is not empty. | | [DuplicateFormatFlagsException](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/DuplicateFormatFlagsException.html) | Unchecked exception thrown when duplicate flags are provided in the format specifier. | | [EOFException](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/EOFException.html) | Signals that an end of file or end of stream has been reached unexpectedly during input. | | [EmptyStackException](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/EmptyStackException.html) | Thrown by methods in the `Stack` class to indicate that the stack is empty. | | [EnumConstantNotPresentException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/EnumConstantNotPresentException.html) | Thrown when an application tries to access an enum constant by name and the enum type contains no constant with the specified name. | | [ExceptionInInitializerError](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ExceptionInInitializerError.html) | Signals that an unexpected exception has occurred in a static initializer. | | [ExecutionException](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/concurrent/ExecutionException.html) | Exception thrown when attempting to retrieve the result of a task that aborted by throwing an exception. | | [ExemptionMechanismException](https://developers.google.com/j2objc/javadoc/jre/reference/javax/crypto/ExemptionMechanismException.html) | This is the generic ExemptionMechanism exception. | | [FactoryConfigurationError](https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/parsers/FactoryConfigurationError.html) | Thrown when a problem with configuration with the Parser Factories exists. | | [FileAlreadyExistsException](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/FileAlreadyExistsException.html) | Checked exception thrown when an attempt is made to create a file or directory and a file of that name already exists. | | [FileLockInterruptionException](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/channels/FileLockInterruptionException.html) | Checked exception received by a thread when another thread interrupts it while it is waiting to acquire a file lock. | | [FileNotFoundException](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/FileNotFoundException.html) | Signals that an attempt to open the file denoted by a specified pathname has failed. | | [FileSystemAlreadyExistsException](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/FileSystemAlreadyExistsException.html) | Runtime exception thrown when an attempt is made to create a file system that already exists. | | [FileSystemException](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/FileSystemException.html) | Thrown when a file system operation fails on one or two files. | | [FileSystemLoopException](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/FileSystemLoopException.html) | Checked exception thrown when a file system loop, or cycle, is encountered. | | [FileSystemNotFoundException](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/FileSystemNotFoundException.html) | Runtime exception thrown when a file system cannot be found. | | [FormatFlagsConversionMismatchException](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/FormatFlagsConversionMismatchException.html) | Unchecked exception thrown when a conversion and flag are incompatible. | | [FormatterClosedException](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/FormatterClosedException.html) | Unchecked exception thrown when the formatter has been closed. | | [GeneralSecurityException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/GeneralSecurityException.html) | The `GeneralSecurityException` class is a generic security exception class that provides type safety for all the security-related exception classes that extend from it. | | [GenericSignatureFormatError](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/reflect/GenericSignatureFormatError.html) | Thrown when a syntactically malformed signature attribute is encountered by a reflective method that needs to interpret the generic signature information for a type, method or constructor. | | [HttpRetryException](https://developers.google.com/j2objc/javadoc/jre/reference/java/net/HttpRetryException.html) | Thrown to indicate that a HTTP request needs to be retried but cannot be retried automatically, due to streaming mode being enabled. | | [IOError](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/IOError.html) | Thrown when a serious I/O error has occurred. | | [IOException](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/IOException.html) | Signals that an I/O exception of some sort has occurred. | | [IllegalAccessError](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IllegalAccessError.html) | Thrown if an application attempts to access or modify a field, or to call a method that it does not have access to. | | [IllegalAccessException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IllegalAccessException.html) | 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](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IllegalArgumentException.html) | Thrown to indicate that a method has been passed an illegal or inappropriate argument. | | [IllegalBlockSizeException](https://developers.google.com/j2objc/javadoc/jre/reference/javax/crypto/IllegalBlockSizeException.html) | 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](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/channels/IllegalBlockingModeException.html) | Unchecked exception thrown when a blocking-mode-specific operation is invoked upon a channel in the incorrect blocking mode. | | [IllegalChannelGroupException](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/channels/IllegalChannelGroupException.html) | Unchecked exception thrown when an attempt is made to open a channel in a group that was not created by the same provider. | | [IllegalCharsetNameException](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/charset/IllegalCharsetNameException.html) | Unchecked exception thrown when a string that is not a [legal charset name](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Charset#names) is used as such. | | [IllegalFormatCodePointException](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/IllegalFormatCodePointException.html) | Unchecked exception thrown when a character with an invalid Unicode code point as defined by `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Character.html#isValidCodePoint(int)` is passed to the `https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Formatter.html`. | | [IllegalFormatConversionException](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/IllegalFormatConversionException.html) | Unchecked exception thrown when the argument corresponding to the format specifier is of an incompatible type. | | [IllegalFormatException](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/IllegalFormatException.html) | Unchecked exception thrown when a format string contains an illegal syntax or a format specifier that is incompatible with the given arguments. | | [IllegalFormatFlagsException](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/IllegalFormatFlagsException.html) | Unchecked exception thrown when an illegal combination flags is given. | | [IllegalFormatPrecisionException](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/IllegalFormatPrecisionException.html) | 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](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/IllegalFormatWidthException.html) | Unchecked exception thrown when the format width is a negative value other than -1 or is otherwise unsupported. | | [IllegalMonitorStateException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IllegalMonitorStateException.html) | 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](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/channels/IllegalSelectorException.html) | 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](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IllegalStateException.html) | Signals that a method has been invoked at an illegal or inappropriate time. | | [IllegalThreadStateException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IllegalThreadStateException.html) | Thrown to indicate that a thread is not in an appropriate state for the requested operation. | | [IllformedLocaleException](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/IllformedLocaleException.html) | Thrown by methods in `https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Locale.html` and `https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Locale.Builder.html` to indicate that an argument is not a well-formed BCP 47 tag. | | [IncompatibleClassChangeError](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IncompatibleClassChangeError.html) | Thrown when an incompatible class change has occurred to some class definition. | | [IncompleteAnnotationException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/annotation/IncompleteAnnotationException.html) | Thrown to indicate that a program has attempted to access an element of an annotation type that was added to the annotation type definition after the annotation was compiled (or serialized). | | [IndexOutOfBoundsException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IndexOutOfBoundsException.html) | 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. | | [InputMismatchException](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/InputMismatchException.html) | 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. | | [InstantiationError](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/InstantiationError.html) | Thrown when an application tries to use the Java `new` construct to instantiate an abstract class or an interface. | | [InstantiationException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/InstantiationException.html) | 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. | | [InternalError](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/InternalError.html) | Thrown to indicate some unexpected internal error has occurred in the Java Virtual Machine. | | [InterruptedByTimeoutException](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/channels/InterruptedByTimeoutException.html) | Checked exception received by a thread when a timeout elapses before an asynchronous operation completes. | | [InterruptedException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/InterruptedException.html) | Thrown when a thread is waiting, sleeping, or otherwise occupied, and the thread is interrupted, either before or during the activity. | | [InterruptedIOException](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/InterruptedIOException.html) | Signals that an I/O operation has been interrupted. | | [IntrospectionException](https://developers.google.com/j2objc/javadoc/jre/reference/java/beans/IntrospectionException.html) |   | | [InvalidAlgorithmParameterException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/InvalidAlgorithmParameterException.html) | This is the exception for invalid or inappropriate algorithm parameters. | | [InvalidClassException](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/InvalidClassException.html) | Thrown when the Serialization runtime detects one of the following problems with a Class. | | [InvalidKeyException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/InvalidKeyException.html) | This is the exception for invalid Keys (invalid encoding, wrong length, uninitialized, etc). | | [InvalidKeySpecException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/spec/InvalidKeySpecException.html) | This is the exception for invalid key specifications. | | [InvalidMarkException](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/InvalidMarkException.html) | Unchecked exception thrown when an attempt is made to reset a buffer when its mark is not defined. | | [InvalidObjectException](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/InvalidObjectException.html) | Indicates that one or more deserialized objects failed validation tests. | | [InvalidParameterException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/InvalidParameterException.html) | This exception, designed for use by the JCA/JCE engine classes, is thrown when an invalid parameter is passed to a method. | | [InvalidParameterSpecException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/spec/InvalidParameterSpecException.html) | This is the exception for invalid parameter specifications. | | [InvalidPathException](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/InvalidPathException.html) | Unchecked exception thrown when path string cannot be converted into a `https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/Path.html` because the path string contains invalid characters, or the path string is invalid for other file system specific reasons. | | [InvalidPropertiesFormatException](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/InvalidPropertiesFormatException.html) | 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 `https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Properties.html` specification. | | [InvocationTargetException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/reflect/InvocationTargetException.html) | InvocationTargetException is a checked exception that wraps an exception thrown by an invoked method or constructor. | | [JarException](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/jar/JarException.html) | Signals that an error of some sort has occurred while reading from or writing to a JAR file. | | [KeyException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/KeyException.html) | This is the basic key exception. | | [KeyManagementException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/KeyManagementException.html) | This is the general key management exception for all operations dealing with key management. | | [KeyStoreException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/KeyStoreException.html) | This is the generic KeyStore exception. | | [LSException](https://developers.google.com/j2objc/javadoc/jre/reference/org/w3c/dom/ls/LSException.html) | Parser or write operations may throw an `LSException` if the processing is stopped. | | [LinkageError](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/LinkageError.html) | Subclasses of `LinkageError` indicate that a class has some dependency on another class; however, the latter class has incompatibly changed after the compilation of the former class. | | [MalformedInputException](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/charset/MalformedInputException.html) | 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. | | [MalformedParameterizedTypeException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/reflect/MalformedParameterizedTypeException.html) | Thrown when a semantically malformed parameterized type is encountered by a reflective method that needs to instantiate it. | | [MalformedURLException](https://developers.google.com/j2objc/javadoc/jre/reference/java/net/MalformedURLException.html) | Thrown to indicate that a malformed URL has occurred. | | [MissingFormatArgumentException](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/MissingFormatArgumentException.html) | 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](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/MissingFormatWidthException.html) | Unchecked exception thrown when the format width is required. | | [MissingResourceException](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/MissingResourceException.html) | Signals that a resource is missing. | | [NegativeArraySizeException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/NegativeArraySizeException.html) | Thrown if an application tries to create an array with negative size. | | [NoClassDefFoundError](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/NoClassDefFoundError.html) | Thrown if the Java Virtual Machine or a `ClassLoader` instance tries to load in the definition of a class (as part of a normal method call or as part of creating a new instance using the `new` expression) and no definition of the class could be found. | | [NoConnectionPendingException](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/channels/NoConnectionPendingException.html) | Unchecked exception thrown when the `https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/channels/SocketChannel.html#finishConnect()` method of a `https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/channels/SocketChannel.html` is invoked without first successfully invoking its `https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/channels/SocketChannel.html#connect(java.net.SocketAddress)` method. | | [NoRouteToHostException](https://developers.google.com/j2objc/javadoc/jre/reference/java/net/NoRouteToHostException.html) | Signals that an error occurred while attempting to connect a socket to a remote address and port. | | [NoSuchAlgorithmException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/NoSuchAlgorithmException.html) | This exception is thrown when a particular cryptographic algorithm is requested but is not available in the environment. | | [NoSuchElementException](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/NoSuchElementException.html) | Thrown by various accessor methods to indicate that the element being requested does not exist. | | [NoSuchFieldError](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/NoSuchFieldError.html) | Thrown if an application tries to access or modify a specified field of an object, and that object no longer has that field. | | [NoSuchFieldException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/NoSuchFieldException.html) | Signals that the class doesn't have a field of a specified name. | | [NoSuchFileException](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/NoSuchFileException.html) | Checked exception thrown when an attempt is made to access a file that does not exist. | | [NoSuchMethodError](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/NoSuchMethodError.html) | Thrown if an application tries to call a specified method of a class (either static or instance), and that class no longer has a definition of that method. | | [NoSuchMethodException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/NoSuchMethodException.html) | Thrown when a particular method cannot be found. | | [NoSuchPaddingException](https://developers.google.com/j2objc/javadoc/jre/reference/javax/crypto/NoSuchPaddingException.html) | This exception is thrown when a particular padding mechanism is requested but is not available in the environment. | | [NoSuchProviderException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/NoSuchProviderException.html) | This exception is thrown when a particular security provider is requested but is not available in the environment. | | [NonReadableChannelException](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/channels/NonReadableChannelException.html) | Unchecked exception thrown when an attempt is made to read from a channel that was not originally opened for reading. | | [NonWritableChannelException](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/channels/NonWritableChannelException.html) | Unchecked exception thrown when an attempt is made to write to a channel that was not originally opened for writing. | | [NotActiveException](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/NotActiveException.html) | Thrown when serialization or deserialization is not active. | | [NotDirectoryException](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/NotDirectoryException.html) | Checked exception thrown when a file system operation, intended for a directory, fails because the file is not a directory. | | [NotLinkException](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/NotLinkException.html) | Checked exception thrown when a file system operation fails because a file is not a symbolic link. | | [NotSerializableException](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/NotSerializableException.html) | Thrown when an instance is required to have a Serializable interface. | | [NotYetBoundException](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/channels/NotYetBoundException.html) | 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](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/channels/NotYetConnectedException.html) | Unchecked exception thrown when an attempt is made to invoke an I/O operation upon a socket channel that is not yet connected. | | [NullPointerException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/NullPointerException.html) | Thrown when an application attempts to use `null` in a case where an object is required. | | [NumberFormatException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/NumberFormatException.html) | 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](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/ObjectStreamException.html) | Superclass of all exceptions specific to Object Stream classes. | | [OptionalDataException](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/OptionalDataException.html) | 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. | | [OutOfMemoryError](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/OutOfMemoryError.html) | Thrown when the Java Virtual Machine cannot allocate an object because it is out of memory, and no more memory could be made available by the garbage collector. | | [OverlappingFileLockException](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/channels/OverlappingFileLockException.html) | 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. | | [ParseException](https://developers.google.com/j2objc/javadoc/jre/reference/java/text/ParseException.html) | Signals that an error has been reached unexpectedly while parsing. | | [ParserConfigurationException](https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/parsers/ParserConfigurationException.html) | Indicates a serious configuration error. | | [PatternSyntaxException](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/regex/PatternSyntaxException.html) | Unchecked exception thrown to indicate a syntax error in a regular-expression pattern. | | [PortUnreachableException](https://developers.google.com/j2objc/javadoc/jre/reference/java/net/PortUnreachableException.html) | Signals that an ICMP Port Unreachable message has been received on a connected datagram. | | [PrivilegedActionException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/PrivilegedActionException.html) | Legacy security code; do not use. | | [PropertyVetoException](https://developers.google.com/j2objc/javadoc/jre/reference/java/beans/PropertyVetoException.html) | Indicates that a proposed property change is unacceptable. | | [ProtocolException](https://developers.google.com/j2objc/javadoc/jre/reference/java/net/ProtocolException.html) | Thrown to indicate that there is an error in the underlying protocol, such as a TCP error. | | [ProviderException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/ProviderException.html) | 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](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/ProviderMismatchException.html) | 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](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/ProviderNotFoundException.html) | Runtime exception thrown when a provider of the required type cannot be found. | | [ReadOnlyBufferException](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/ReadOnlyBufferException.html) | Unchecked exception thrown when a content-mutation method such as put or compact is invoked upon a read-only buffer. | | [ReadOnlyFileSystemException](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/ReadOnlyFileSystemException.html) | Unchecked exception thrown when an attempt is made to update an object associated with a `https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/FileSystem.html#isReadOnly()` `FileSystem`. | | [ReadPendingException](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/channels/ReadPendingException.html) | Unchecked exception thrown when an attempt is made to read from an asynchronous socket channel and a previous read has not completed. | | [ReflectiveOperationException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ReflectiveOperationException.html) | Common superclass of exceptions thrown by reflective operations in core reflection. | | [RejectedExecutionException](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/concurrent/RejectedExecutionException.html) | Exception thrown by an `https://developers.google.com/j2objc/javadoc/jre/reference/java/util/concurrent/Executor.html` when a task cannot be accepted for execution. | | [RuntimeException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/RuntimeException.html) | `RuntimeException` is the superclass of those exceptions that can be thrown during the normal operation of the Java Virtual Machine. | | [SAXException](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/SAXException.html) | Encapsulate a general SAX error or warning. | | [SAXNotRecognizedException](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/SAXNotRecognizedException.html) | Exception class for an unrecognized identifier. | | [SAXNotSupportedException](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/SAXNotSupportedException.html) | Exception class for an unsupported operation. | | [SAXParseException](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/SAXParseException.html) | Encapsulate an XML parse error or warning. | | [SQLClientInfoException](https://developers.google.com/j2objc/javadoc/jre/reference/java/sql/SQLClientInfoException.html) | The subclass of `https://developers.google.com/j2objc/javadoc/jre/reference/java/sql/SQLException.html` is thrown when one or more client info properties could not be set on a `Connection`. | | [SQLDataException](https://developers.google.com/j2objc/javadoc/jre/reference/java/sql/SQLDataException.html) | The subclass of `https://developers.google.com/j2objc/javadoc/jre/reference/java/sql/SQLException.html` thrown when the SQLState class value is '*22*', or under vendor-specified conditions. | | [SQLException](https://developers.google.com/j2objc/javadoc/jre/reference/java/sql/SQLException.html) | An exception that provides information on a database access error or other errors. | | [SQLFeatureNotSupportedException](https://developers.google.com/j2objc/javadoc/jre/reference/java/sql/SQLFeatureNotSupportedException.html) | The subclass of `https://developers.google.com/j2objc/javadoc/jre/reference/java/sql/SQLException.html` thrown when the SQLState class value is '*0A*' ( the value is 'zero' A). | | [SQLIntegrityConstraintViolationException](https://developers.google.com/j2objc/javadoc/jre/reference/java/sql/SQLIntegrityConstraintViolationException.html) | The subclass of `https://developers.google.com/j2objc/javadoc/jre/reference/java/sql/SQLException.html` thrown when the SQLState class value is '*23*', or under vendor-specified conditions. | | [SQLInvalidAuthorizationSpecException](https://developers.google.com/j2objc/javadoc/jre/reference/java/sql/SQLInvalidAuthorizationSpecException.html) | The subclass of `https://developers.google.com/j2objc/javadoc/jre/reference/java/sql/SQLException.html` thrown when the SQLState class value is '*28*', or under vendor-specified conditions. | | [SQLNonTransientConnectionException](https://developers.google.com/j2objc/javadoc/jre/reference/java/sql/SQLNonTransientConnectionException.html) | The subclass of `https://developers.google.com/j2objc/javadoc/jre/reference/java/sql/SQLException.html` thrown for the SQLState class value '*08*', or under vendor-specified conditions. | | [SQLNonTransientException](https://developers.google.com/j2objc/javadoc/jre/reference/java/sql/SQLNonTransientException.html) | The subclass of `https://developers.google.com/j2objc/javadoc/jre/reference/java/sql/SQLException.html` thrown when an instance where a retry of the same operation would fail unless the cause of the `SQLException` is corrected. | | [SQLRecoverableException](https://developers.google.com/j2objc/javadoc/jre/reference/java/sql/SQLRecoverableException.html) | The subclass of `https://developers.google.com/j2objc/javadoc/jre/reference/java/sql/SQLException.html` 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](https://developers.google.com/j2objc/javadoc/jre/reference/java/sql/SQLSyntaxErrorException.html) | The subclass of `https://developers.google.com/j2objc/javadoc/jre/reference/java/sql/SQLException.html` thrown when the SQLState class value is '*42*', or under vendor-specified conditions. | | [SQLTimeoutException](https://developers.google.com/j2objc/javadoc/jre/reference/java/sql/SQLTimeoutException.html) | The subclass of `https://developers.google.com/j2objc/javadoc/jre/reference/java/sql/SQLException.html` thrown when the timeout specified by `Statement` has expired. | | [SQLTransactionRollbackException](https://developers.google.com/j2objc/javadoc/jre/reference/java/sql/SQLTransactionRollbackException.html) | The subclass of `https://developers.google.com/j2objc/javadoc/jre/reference/java/sql/SQLException.html` thrown when the SQLState class value is '*40*', or under vendor-specified conditions. | | [SQLTransientConnectionException](https://developers.google.com/j2objc/javadoc/jre/reference/java/sql/SQLTransientConnectionException.html) | The subclass of `https://developers.google.com/j2objc/javadoc/jre/reference/java/sql/SQLException.html` for the SQLState class value '*08*', or under vendor-specified conditions. | | [SQLTransientException](https://developers.google.com/j2objc/javadoc/jre/reference/java/sql/SQLTransientException.html) | The subclass of `https://developers.google.com/j2objc/javadoc/jre/reference/java/sql/SQLException.html` 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](https://developers.google.com/j2objc/javadoc/jre/reference/java/sql/SQLWarning.html) | An exception that provides information on database access warnings. | | [SSLException](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLException.html) | Indicates some kind of error detected by an SSL subsystem. | | [SSLHandshakeException](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLHandshakeException.html) | Indicates that the client and server could not negotiate the desired level of security. | | [SSLKeyException](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLKeyException.html) | Reports a bad SSL key. | | [SSLPeerUnverifiedException](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLPeerUnverifiedException.html) | Indicates that the peer's identity has not been verified. | | [SSLProtocolException](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLProtocolException.html) | Reports an error in the operation of the SSL protocol. | | [SecurityException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/SecurityException.html) | Thrown by the security manager to indicate a security violation. | | [ServiceConfigurationError](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/ServiceConfigurationError.html) | Error thrown when something goes wrong while loading a service provider. | | [ShortBufferException](https://developers.google.com/j2objc/javadoc/jre/reference/javax/crypto/ShortBufferException.html) | This exception is thrown when an output buffer provided by the user is too short to hold the operation result. | | [ShutdownChannelGroupException](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/channels/ShutdownChannelGroupException.html) | 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](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/SignatureException.html) | This is the generic Signature exception. | | [SocketException](https://developers.google.com/j2objc/javadoc/jre/reference/java/net/SocketException.html) | Thrown to indicate that there is an error creating or accessing a Socket. | | [SocketTimeoutException](https://developers.google.com/j2objc/javadoc/jre/reference/java/net/SocketTimeoutException.html) | Signals that a timeout has occurred on a socket read or accept. | | [StackOverflowError](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StackOverflowError.html) | Thrown when a stack overflow occurs because an application recurses too deeply. | | [StreamCorruptedException](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/StreamCorruptedException.html) | Thrown when control information that was read from an object stream violates internal consistency checks. | | [StringIndexOutOfBoundsException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StringIndexOutOfBoundsException.html) | Thrown by `String` methods to indicate that an index is either negative or greater than the size of the string. | | [SyncFailedException](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/SyncFailedException.html) | Signals that a sync operation has failed. | | [ThreadDeath](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ThreadDeath.html) | An instance of `ThreadDeath` is thrown in the victim thread when the (deprecated) `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Thread.html#stop()` method is invoked. | | [TimeoutException](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/concurrent/TimeoutException.html) | Exception thrown when a blocking operation times out. | | [TooManyListenersException](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/TooManyListenersException.html) | 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. | | [TransformerConfigurationException](https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/transform/TransformerConfigurationException.html) | Indicates a serious configuration error. | | [TransformerException](https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/transform/TransformerException.html) | This class specifies an exceptional condition that occurred during the transformation process. | | [TransformerFactoryConfigurationError](https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/transform/TransformerFactoryConfigurationError.html) | Thrown when a problem with configuration with the Transformer Factories exists. | | [TypeNotPresentException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/TypeNotPresentException.html) | 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. | | [URISyntaxException](https://developers.google.com/j2objc/javadoc/jre/reference/java/net/URISyntaxException.html) | Checked exception thrown to indicate that a string could not be parsed as a URI reference. | | [UTFDataFormatException](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/UTFDataFormatException.html) | Signals that a malformed string in [modified UTF-8](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/DataInput#modified-utf-8) format has been read in a data input stream or by any class that implements the data input interface. | | [UncheckedIOException](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/UncheckedIOException.html) | Wraps an `https://developers.google.com/j2objc/javadoc/jre/reference/java/io/IOException.html` with an unchecked exception. | | [UndeclaredThrowableException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/reflect/UndeclaredThrowableException.html) | Thrown by a method invocation on a proxy instance if its invocation handler's `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/reflect/InvocationHandler.html#invoke(java.lang.Object,%20java.lang.reflect.Method,%20java.lang.Object[])` 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. | | [UnknownError](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/UnknownError.html) | Thrown when an unknown but serious exception has occurred in the Java Virtual Machine. | | [UnknownFormatConversionException](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/UnknownFormatConversionException.html) | Unchecked exception thrown when an unknown conversion is given. | | [UnknownFormatFlagsException](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/UnknownFormatFlagsException.html) | Unchecked exception thrown when an unknown flag is given. | | [UnknownHostException](https://developers.google.com/j2objc/javadoc/jre/reference/java/net/UnknownHostException.html) | Thrown to indicate that the IP address of a host could not be determined. | | [UnknownServiceException](https://developers.google.com/j2objc/javadoc/jre/reference/java/net/UnknownServiceException.html) | Thrown to indicate that an unknown service exception has occurred. | | [UnmappableCharacterException](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/charset/UnmappableCharacterException.html) | Checked exception thrown when an input character (or byte) sequence is valid but cannot be mapped to an output byte (or character) sequence. | | [UnrecoverableEntryException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/UnrecoverableEntryException.html) | This exception is thrown if an entry in the keystore cannot be recovered. | | [UnrecoverableKeyException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/UnrecoverableKeyException.html) | This exception is thrown if a key in the keystore cannot be recovered. | | [UnresolvedAddressException](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/channels/UnresolvedAddressException.html) | Unchecked exception thrown when an attempt is made to invoke a network operation upon an unresolved socket address. | | [UnsatisfiedLinkError](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/UnsatisfiedLinkError.html) | Thrown if the Java Virtual Machine cannot find an appropriate native-language definition of a method declared `native`. | | [UnsupportedAddressTypeException](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/channels/UnsupportedAddressTypeException.html) | Unchecked exception thrown when an attempt is made to bind or connect to a socket address of a type that is not supported. | | [UnsupportedCallbackException](https://developers.google.com/j2objc/javadoc/jre/reference/javax/security/auth/callback/UnsupportedCallbackException.html) | Signals that a `CallbackHandler` does not recognize a particular `Callback`. | | [UnsupportedCharsetException](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/charset/UnsupportedCharsetException.html) | Unchecked exception thrown when no support is available for a requested charset. | | [UnsupportedClassVersionError](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/UnsupportedClassVersionError.html) | Thrown when the Java Virtual Machine attempts to read a class file and determines that the major and minor version numbers in the file are not supported. | | [UnsupportedEncodingException](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/UnsupportedEncodingException.html) | The Character Encoding is not supported. | | [UnsupportedOperationException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/UnsupportedOperationException.html) | Thrown to indicate that the requested operation is not supported. | | [UnsupportedTemporalTypeException](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/temporal/UnsupportedTemporalTypeException.html) | UnsupportedTemporalTypeException indicates that a ChronoField or ChronoUnit is not supported for a Temporal class. | | [UserPrincipalNotFoundException](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/attribute/UserPrincipalNotFoundException.html) | Checked exception thrown when a lookup of `https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/attribute/UserPrincipal.html` fails because the principal does not exist. | | [VirtualMachineError](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/VirtualMachineError.html) | Thrown to indicate that the Java Virtual Machine is broken or has run out of resources necessary for it to continue operating. | | [WriteAbortedException](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/WriteAbortedException.html) | Signals that one of the ObjectStreamExceptions was thrown during a write operation. | | [WritePendingException](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/channels/WritePendingException.html) | Unchecked exception thrown when an attempt is made to write to an asynchronous socket channel and a previous write has not completed. | | [XPathException](https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/xpath/XPathException.html) | `XPathException` represents a generic XPath exception. | | [XPathExpressionException](https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/xpath/XPathExpressionException.html) | `XPathExpressionException` represents an error in an XPath expression. | | [XPathFactoryConfigurationException](https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/xpath/XPathFactoryConfigurationException.html) | `XPathFactoryConfigurationException` represents a configuration error in a `XPathFactory` environment. | | [XPathFunctionException](https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/xpath/XPathFunctionException.html) | `XPathFunctionException` represents an error with an XPath function. | | [ZipError](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/ZipError.html) | Signals that an unrecoverable error has occurred. | | [ZipException](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/ZipException.html) | Signals that a Zip exception of some sort has occurred. | | [ZoneRulesException](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/zone/ZoneRulesException.html) | Thrown to indicate a problem with time-zone configuration. | |||

The `Throwable` class is the superclass of all errors and
exceptions in the Java language. Only objects that are instances of this
class (or one of its subclasses) are thrown by the Java Virtual Machine or
can be thrown by the Java `throw` statement. Similarly, only
this class or one of its subclasses can be the argument type in a
`catch` clause.

For the purposes of compile-time checking of exceptions, `Throwable` and any subclass of `Throwable` that is not also a
subclass of either `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/RuntimeException.html` or `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Error.html` are
regarded as checked exceptions.

Instances of two subclasses, `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Error.html` and
`https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Exception.html`, are conventionally used to indicate
that exceptional situations have occurred. Typically, these instances
are freshly created in the context of the exceptional situation so
as to include relevant information (such as stack trace data).

A throwable contains a snapshot of the execution stack of its
thread at the time it was created. It can also contain a message
string that gives more information about the error. Over time, a
throwable can {@linkplain Throwable#addSuppressed suppress} other
throwables from being propagated. Finally, the throwable can also
contain a *cause*: another throwable that caused this
throwable to be constructed. The recording of this causal information
is referred to as the *chained exception* facility, as the
cause can, itself, have a cause, and so on, leading to a "chain" of
exceptions, each caused by another.

One reason that a throwable may have a cause is that the class that
throws it is built atop a lower layered abstraction, and an operation on
the upper layer fails due to a failure in the lower layer. It would be bad
design to let the throwable thrown by the lower layer propagate outward, as
it is generally unrelated to the abstraction provided by the upper layer.
Further, doing so would tie the API of the upper layer to the details of
its implementation, assuming the lower layer's exception was a checked
exception. Throwing a "wrapped exception" (i.e., an exception containing a
cause) allows the upper layer to communicate the details of the failure to
its caller without incurring either of these shortcomings. It preserves
the flexibility to change the implementation of the upper layer without
changing its API (in particular, the set of exceptions thrown by its
methods).

A second reason that a throwable may have a cause is that the method
that throws it must conform to a general-purpose interface that does not
permit the method to throw the cause directly. For example, suppose
a persistent collection conforms to the `https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Collection.html` interface, and that its persistence is implemented atop
`java.io`. Suppose the internals of the `add` method
can throw an `https://developers.google.com/j2objc/javadoc/jre/reference/java/io/IOException.html`. The implementation
can communicate the details of the `IOException` to its caller
while conforming to the `Collection` interface by wrapping the
`IOException` in an appropriate unchecked exception. (The
specification for the persistent collection should indicate that it is
capable of throwing such exceptions.)

A cause can be associated with a throwable in two ways: via a
constructor that takes the cause as an argument, or via the
`https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#initCause(java.lang.Throwable)` method. New throwable classes that
wish to allow causes to be associated with them should provide constructors
that take a cause and delegate (perhaps indirectly) to one of the
`Throwable` constructors that takes a cause.

Because the `initCause` method is public, it allows a cause to be
associated with any throwable, even a "legacy throwable" whose
implementation predates the addition of the exception chaining mechanism to
`Throwable`.

By convention, class `Throwable` and its subclasses have two
constructors, one that takes no arguments and one that takes a
`String` argument that can be used to produce a detail message.
Further, those subclasses that might likely have a cause associated with
them should have two more constructors, one that takes a
`Throwable` (the cause), and one that takes a
`String` (the detail message) and a `Throwable` (the
cause).

J2ObjC: Throwable extends the Objective-C Foundation class NSException.

### Public Constructor Summary

|---|---|
|   | [Throwable](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#Throwable())() Constructs a new throwable with `null` as its detail message. |
|   | [Throwable](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#Throwable(java.lang.String))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) message) Constructs a new throwable with the specified detail message. |
|   | [Throwable](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#Throwable(java.lang.String,%20java.lang.Throwable))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) message, [Throwable](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html) cause) Constructs a new throwable with the specified detail message and cause. |
|   | [Throwable](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#Throwable(java.lang.Throwable))([Throwable](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html) cause) Constructs a new throwable 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 Constructor Summary

|---|---|
|   | [Throwable](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#Throwable(java.lang.String,%20java.lang.Throwable,%20boolean,%20boolean))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) message, [Throwable](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html) cause, boolean enableSuppression, boolean writableStackTrace) Constructs a new throwable with the specified detail message, cause, {@linkplain #addSuppressed suppression} enabled or disabled, and writable stack trace enabled or disabled. |

### Public Method Summary

|---|---|
| synchronized final void | [addSuppressed](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#addSuppressed(java.lang.Throwable))([Throwable](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html) exception) Appends the specified exception to the exceptions that were suppressed in order to deliver this exception. |
| synchronized [Throwable](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html) | [fillInStackTrace](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#fillInStackTrace())() Fills in the execution stack trace. |
| synchronized [Throwable](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html) | [getCause](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#getCause())() Returns the cause of this throwable or `null` if the cause is nonexistent or unknown. |
| [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [getLocalizedMessage](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#getLocalizedMessage())() Creates a localized description of this throwable. |
| [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [getMessage](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#getMessage())() Returns the detail message string of this throwable. |
| StackTraceElement\[\] | [getStackTrace](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#getStackTrace())() Provides programmatic access to the stack trace information printed by `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#printStackTrace()`. |
| synchronized final [Throwable\[\]](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html) | [getSuppressed](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#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. |
| synchronized [Throwable](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html) | [initCause](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#initCause(java.lang.Throwable))([Throwable](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html) cause) Initializes the *cause* of this throwable to the specified value. |
| void | [printStackTrace](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#printStackTrace())() Prints this throwable and its backtrace to the standard error stream. |
| void | [printStackTrace](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#printStackTrace(java.io.PrintWriter))([PrintWriter](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/PrintWriter.html) s) Prints this throwable and its backtrace to the specified print writer. |
| void | [printStackTrace](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#printStackTrace(java.io.PrintStream))([PrintStream](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/PrintStream.html) s) Prints this throwable and its backtrace to the specified print stream. |
| void | [setStackTrace](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#setStackTrace(java.lang.StackTraceElement[]))(StackTraceElement\[\] stackTrace) Sets the stack trace elements that will be returned by `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#getStackTrace()` and printed by `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#printStackTrace()` and related methods. |
| [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [toString](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#toString())() Returns a short description of this throwable. |

### Inherited Method Summary

From class [java.lang.Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html)

|---|---|
| [Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) | [clone](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#clone())() Creates and returns a copy of this `Object`. |
| boolean | [equals](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#equals(java.lang.Object))([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) obj) Compares this instance with the specified object and indicates if they are equal. |
| void | [finalize](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#finalize())() Invoked when the garbage collector has detected that this instance is no longer reachable. |
| final [Class](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html)\<?\> | [getClass](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#getClass())() Returns the unique instance of `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html` that represents this object's class. |
| int | [hashCode](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#hashCode())() Returns an integer hash code for this object. |
| final void | [notify](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#notify())() Causes a thread which is waiting on this object's monitor (by means of calling one of the `wait()` methods) to be woken up. |
| final void | [notifyAll](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#notifyAll())() Causes all threads which are waiting on this object's monitor (by means of calling one of the `wait()` methods) to be woken up. |
| [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [toString](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#toString())() Returns a string containing a concise, human-readable description of this object. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait(long,%20int))(long timeout, int nanos) Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object or until the specified timeout expires. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait(long))(long timeout) Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object or until the specified timeout expires. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait())() Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object. |

## Public Constructors

#### public
**Throwable**
()

Constructs a new throwable with `null` as its detail message.
The cause is not initialized, and may subsequently be initialized by a
call to `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#initCause(java.lang.Throwable)`.

The `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#fillInStackTrace()` method is called to initialize
the stack trace data in the newly created throwable.

#### public
**Throwable**
([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) message)

Constructs a new throwable with the specified detail message. The
cause is not initialized, and may subsequently be initialized by
a call to `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#initCause(java.lang.Throwable)`.

The `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#fillInStackTrace()` method is called to initialize
the stack trace data in the newly created throwable.

##### Parameters

| message | the detail message. The detail message is saved for later retrieval by the `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#getMessage()` method. |
|---|---|

#### public
**Throwable**
([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) message, [Throwable](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html) cause)

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

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

The `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#fillInStackTrace()` method is called to initialize
the stack trace data in the newly created throwable.

##### Parameters

| message | the detail message (which is saved for later retrieval by the `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#getMessage()` method). |
| cause | the cause (which is saved for later retrieval by the `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#getCause()` method). (A `null` value is permitted, and indicates that the cause is nonexistent or unknown.) |
|---|---|

#### public
**Throwable**
([Throwable](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html) cause)

Constructs a new throwable 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 throwables that are little more than
wrappers for other throwables (for example, `https://developers.google.com/j2objc/javadoc/jre/reference/java/security/PrivilegedActionException.html`).

The `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#fillInStackTrace()` method is called to initialize
the stack trace data in the newly created throwable.

##### Parameters

| cause | the cause (which is saved for later retrieval by the `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#getCause()` method). (A `null` value is permitted, and indicates that the cause is nonexistent or unknown.) |
|---|---|

## Protected Constructors

#### protected
**Throwable**
([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) message, [Throwable](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html) cause, boolean enableSuppression, boolean writableStackTrace)

Constructs a new throwable with the specified detail message,
cause, {@linkplain #addSuppressed suppression} enabled or
disabled, and writable stack trace enabled or disabled. If
suppression is disabled, `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#getSuppressed()` for this object
will return a zero-length array and calls to `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#addSuppressed(java.lang.Throwable)` that would otherwise append an exception to the
suppressed list will have no effect. If the writable stack
trace is false, this constructor will not call `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#fillInStackTrace()`, a `null` will be written to the
`stackTrace` field, and subsequent calls to `fillInStackTrace` and `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#setStackTrace(java.lang.StackTraceElement[])` will not set the stack
trace. If the writable stack trace is false, `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#getStackTrace()` will return a zero length array.

Note that the other constructors of `Throwable` treat
suppression as being enabled and the stack trace as being
writable. Subclasses of `Throwable` should document any
conditions under which suppression is disabled and document
conditions under which the stack trace is not writable.
Disabling of suppression should only occur in exceptional
circumstances where special requirements exist, such as a
virtual machine reusing exception objects under low-memory
situations. Circumstances where a given exception object is
repeatedly caught and rethrown, such as to implement control
flow between two sub-systems, is another situation where
immutable throwable objects would be appropriate.

##### Parameters

| message | the detail message. |
| cause | the cause. (A `null` value is permitted, and indicates that the cause is nonexistent or unknown.) |
| enableSuppression | whether or not suppression is enabled or disabled |
| writableStackTrace | whether or not the stack trace should be writable |
|---|---|

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/OutOfMemoryError.html`
- `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/NullPointerException.html`
- `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ArithmeticException.html`

## Public Methods

#### public final synchronized void
**addSuppressed**
([Throwable](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html) exception)

Appends the specified exception to the exceptions that were
suppressed in order to deliver this exception. This method is
thread-safe and typically called (automatically and implicitly)
by the `try`-with-resources statement.

The suppression behavior is enabled *unless* disabled
{@linkplain #Throwable(String, Throwable, boolean, boolean) via
a constructor}. When suppression is disabled, this method does
nothing other than to validate its argument.

Note that when one exception {@linkplain #initCause(Throwable) causes} another exception, the first
exception is usually caught and then the second exception is
thrown in response. In other words, there is a causal
connection between the two exceptions.

In contrast, there are situations where two independent
exceptions can be thrown in sibling code blocks, in particular
in the `try` block of a `try`-with-resources
statement and the compiler-generated `finally` block
which closes the resource.

In these situations, only one of the thrown exceptions can be
propagated. In the `try`-with-resources statement, when
there are two such exceptions, the exception originating from
the `try` block is propagated and the exception from the
`finally` block is added to the list of exceptions
suppressed by the exception from the `try` block. As an
exception unwinds the stack, it can accumulate multiple
suppressed exceptions.

An exception may have suppressed exceptions while also being
caused by another exception. Whether or not an exception has a
cause is semantically known at the time of its creation, unlike
whether or not an exception will suppress other exceptions
which is typically only determined after an exception is
thrown.

Note that programmer written code is also able to take
advantage of calling this method in situations where there are
multiple sibling exceptions and only one can be propagated.

##### Parameters

| exception | the exception to be added to the list of suppressed exceptions |
|---|---|

##### Throws

| [IllegalArgumentException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IllegalArgumentException.html) | if `exception` is this throwable; a throwable cannot suppress itself. |
| [NullPointerException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/NullPointerException.html) | if `exception` is `null` |
|---|---|

#### public synchronized [Throwable](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html)
**fillInStackTrace**
()

Fills in the execution stack trace. This method records within this
`Throwable` object information about the current state of
the stack frames for the current thread.

If the stack trace of this `Throwable` {@linkplain Throwable#Throwable(String, Throwable, boolean, boolean) is not
writable}, calling this method has no effect.

##### Returns

- a reference to this `Throwable` instance.

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#printStackTrace()`

#### public synchronized [Throwable](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html)
**getCause**
()

Returns the cause of this throwable or `null` if the
cause is nonexistent or unknown. (The cause is the throwable that
caused this throwable to get thrown.)

This implementation returns the cause that was supplied via one of
the constructors requiring a `Throwable`, or that was set after
creation with the `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#initCause(java.lang.Throwable)` method. While it is
typically unnecessary to override this method, a subclass can override
it to return a cause set by some other means. This is appropriate for
a "legacy chained throwable" that predates the addition of chained
exceptions to `Throwable`. Note that it is *not*
necessary to override any of the `PrintStackTrace` methods,
all of which invoke the `getCause` method to determine the
cause of a throwable.

##### Returns

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

#### public [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html)
**getLocalizedMessage**
()

Creates a localized description of this throwable.
Subclasses may override this method in order to produce a
locale-specific message. For subclasses that do not override this
method, the default implementation returns the same result as
`getMessage()`.

##### Returns

- The localized description of this throwable.

#### public [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html)
**getMessage**
()

Returns the detail message string of this throwable.

##### Returns

- the detail message string of this `Throwable` instance (which may be `null`).

#### public StackTraceElement\[\]
**getStackTrace**
()

Provides programmatic access to the stack trace information printed by
`https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#printStackTrace()`. Returns an array of stack trace elements,
each representing one stack frame. The zeroth element of the array
(assuming the array's length is non-zero) represents the top of the
stack, which is the last method invocation in the sequence. Typically,
this is the point at which this throwable was created and thrown.
The last element of the array (assuming the array's length is non-zero)
represents the bottom of the stack, which is the first method invocation
in the sequence.

Some virtual machines may, under some circumstances, omit one
or more stack frames from the stack trace. In the extreme case,
a virtual machine that has no stack trace information concerning
this throwable is permitted to return a zero-length array from this
method. Generally speaking, the array returned by this method will
contain one element for every frame that would be printed by
`printStackTrace`. Writes to the returned array do not
affect future calls to this method.

##### Returns

- an array of stack trace elements representing the stack trace pertaining to this throwable.

#### public final synchronized [Throwable\[\]](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html)
**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.

If no exceptions were suppressed or {@linkplain #Throwable(String, Throwable, boolean, boolean) suppression is
disabled}, an empty array is returned. This method is
thread-safe. Writes to the returned array do not affect future
calls to this method.

##### Returns

- an array containing all of the exceptions that were suppressed to deliver this exception.

#### public synchronized [Throwable](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html)
**initCause**
([Throwable](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html) cause)

Initializes the *cause* of this throwable to the specified value.
(The cause is the throwable that caused this throwable to get thrown.)

This method can be called at most once. It is generally called from
within the constructor, or immediately after creating the
throwable. If this throwable was created
with `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#Throwable(java.lang.Throwable)` or
`https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#Throwable(java.lang.String,%20java.lang.Throwable)`, this method cannot be called
even once.

An example of using this method on a legacy throwable type
without other support for setting the cause is:

```
 try {
     lowLevelOp();
 } catch (LowLevelException le) {
     throw (HighLevelException)
           new HighLevelException().initCause(le); // Legacy constructor
 }
 
```

<br />

##### Parameters

| cause | the cause (which is saved for later retrieval by the `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#getCause()` method). (A `null` value is permitted, and indicates that the cause is nonexistent or unknown.) |
|---|---|

##### Returns

- a reference to this `Throwable` instance.

##### Throws

| [IllegalArgumentException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IllegalArgumentException.html) | if `cause` is this throwable. (A throwable cannot be its own cause.) |
| [IllegalStateException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IllegalStateException.html) | if this throwable was created with `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#Throwable(java.lang.Throwable)` or `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#Throwable(java.lang.String,%20java.lang.Throwable)`, or this method has already been called on this throwable. |
|---|---|

#### public void
**printStackTrace**
()

Prints this throwable and its backtrace to the
standard error stream. This method prints a stack trace for this
`Throwable` object on the error output stream that is
the value of the field `System.err`. The first line of
output contains the result of the `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#toString()` method for
this object. Remaining lines represent data previously recorded by
the method `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#fillInStackTrace()`. The format of this
information depends on the implementation, but the following
example may be regarded as typical:
>
> ```
>  java.lang.NullPointerException
>          at MyClass.mash(MyClass.java:9)
>          at MyClass.crunch(MyClass.java:6)
>          at MyClass.main(MyClass.java:3)
>  
> ```
This example was produced by running the program:

```
 class MyClass {
     public static void main(String[] args) {
         crunch(null);
     }
     static void crunch(int[] a) {
         mash(a);
     }
     static void mash(int[] b) {
         System.out.println(b[0]);
     }
 }
 
```
The backtrace for a throwable with an initialized, non-null cause should generally include the backtrace for the cause. The format of this information depends on the implementation, but the following example may be regarded as typical:

```
 HighLevelException: MidLevelException: LowLevelException
         at Junk.a(Junk.java:13)
         at Junk.main(Junk.java:4)
 Caused by: MidLevelException: LowLevelException
         at Junk.c(Junk.java:23)
         at Junk.b(Junk.java:17)
         at Junk.a(Junk.java:11)
         ... 1 more
 Caused by: LowLevelException
         at Junk.e(Junk.java:30)
         at Junk.d(Junk.java:27)
         at Junk.c(Junk.java:21)
         ... 3 more
 
```
Note the presence of lines containing the characters `"..."`. These lines indicate that the remainder of the stack trace for this exception matches the indicated number of frames from the bottom of the stack trace of the exception that was caused by this exception (the "enclosing" exception). This shorthand can greatly reduce the length of the output in the common case where a wrapped exception is thrown from same method as the "causative exception" is caught. The above example was produced by running the program:

```
 public class Junk {
     public static void main(String args[]) {
         try {
             a();
         } catch(HighLevelException e) {
             e.printStackTrace();
         }
     }
     static void a() throws HighLevelException {
         try {
             b();
         } catch(MidLevelException e) {
             throw new HighLevelException(e);
         }
     }
     static void b() throws MidLevelException {
         c();
     }
     static void c() throws MidLevelException {
         try {
             d();
         } catch(LowLevelException e) {
             throw new MidLevelException(e);
         }
     }
     static void d() throws LowLevelException {
        e();
     }
     static void e() throws LowLevelException {
         throw new LowLevelException();
     }
 }

 class HighLevelException extends Exception {
     HighLevelException(Throwable cause) { super(cause); }
 }

 class MidLevelException extends Exception {
     MidLevelException(Throwable cause)  { super(cause); }
 }

 class LowLevelException extends Exception {
 }
 
```
As of release 7, the platform supports the notion of *suppressed exceptions* (in conjunction with the `try`-with-resources statement). Any exceptions that were suppressed in order to deliver an exception are printed out beneath the stack trace. The format of this information depends on the implementation, but the following example may be regarded as typical:

```
 Exception in thread "main" java.lang.Exception: Something happened
  at Foo.bar(Foo.java:10)
  at Foo.main(Foo.java:5)
  Suppressed: Resource$CloseFailException: Resource ID = 0
          at Resource.close(Resource.java:26)
          at Foo.bar(Foo.java:9)
          ... 1 more
 
```
Note that the "... n more" notation is used on suppressed exceptions just at it is used on causes. Unlike causes, suppressed exceptions are indented beyond their "containing exceptions."

An exception can have both a cause and one or more suppressed
exceptions:

```
 Exception in thread "main" java.lang.Exception: Main block
  at Foo3.main(Foo3.java:7)
  Suppressed: Resource$CloseFailException: Resource ID = 2
          at Resource.close(Resource.java:26)
          at Foo3.main(Foo3.java:5)
  Suppressed: Resource$CloseFailException: Resource ID = 1
          at Resource.close(Resource.java:26)
          at Foo3.main(Foo3.java:5)
 Caused by: java.lang.Exception: I did it
  at Foo3.main(Foo3.java:8)
 
```
Likewise, a suppressed exception can have a cause:

```
 Exception in thread "main" java.lang.Exception: Main block
  at Foo4.main(Foo4.java:6)
  Suppressed: Resource2$CloseFailException: Resource ID = 1
          at Resource2.close(Resource2.java:20)
          at Foo4.main(Foo4.java:5)
  Caused by: java.lang.Exception: Rats, you caught me
          at Resource2$CloseFailException.(Resource2.java:45)
          ... 2 more
 
```

<br />

#### public void
**printStackTrace**
([PrintWriter](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/PrintWriter.html) s)

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

##### Parameters

| s | `PrintWriter` to use for output |
|---|---|

#### public void
**printStackTrace**
([PrintStream](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/PrintStream.html) s)

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

##### Parameters

| s | `PrintStream` to use for output |
|---|---|

#### public void
**setStackTrace**
(StackTraceElement\[\] stackTrace)

Sets the stack trace elements that will be returned by
`https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#getStackTrace()` and printed by `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#printStackTrace()`
and related methods.

This method, which is designed for use by RPC frameworks and other
advanced systems, allows the client to override the default
stack trace that is either generated by `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#fillInStackTrace()`
when a throwable is constructed or deserialized when a throwable is
read from a serialization stream.

If the stack trace of this `Throwable` {@linkplain Throwable#Throwable(String, Throwable, boolean, boolean) is not
writable}, calling this method has no effect other than
validating its argument.

##### Parameters

| stackTrace | the stack trace elements to be associated with this `Throwable`. The specified array is copied by this call; changes in the specified array after the method invocation returns will have no affect on this `Throwable`'s stack trace. |
|---|---|

##### Throws

| [NullPointerException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/NullPointerException.html) | if `stackTrace` is `null` or if any of the elements of `stackTrace` are `null` |
|---|---|

#### public [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html)
**toString**
()

Returns a short description of this throwable.
The result is the concatenation of:

- the {@linkplain Class#getName() name} of the class of this object
- ": " (a colon and a space)
- the result of invoking this object's `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#getLocalizedMessage()` method

If `getLocalizedMessage` returns `null`, then just the class name is returned.

<br />

##### Returns

- a string representation of this throwable.