# Error

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

|---|---|---|
| Known Direct Subclasses [AnnotationFormatError](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/annotation/AnnotationFormatError.html), [AssertionError](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/AssertionError.html), [CoderMalfunctionError](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/charset/CoderMalfunctionError.html), [FactoryConfigurationError](https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/parsers/FactoryConfigurationError.html), [IOError](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/IOError.html), [LinkageError](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/LinkageError.html), [ServiceConfigurationError](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/ServiceConfigurationError.html), [ThreadDeath](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ThreadDeath.html), [TransformerFactoryConfigurationError](https://developers.google.com/j2objc/javadoc/jre/reference/javax/xml/transform/TransformerFactoryConfigurationError.html), [VirtualMachineError](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/VirtualMachineError.html) |---|---| | [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. | | [AssertionError](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/AssertionError.html) | Thrown to indicate that an assertion has failed. | | [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. | | [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. | | [IOError](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/IOError.html) | Thrown when a serious I/O error has occurred. | | [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. | | [ServiceConfigurationError](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/ServiceConfigurationError.html) | Error thrown when something goes wrong while loading a service provider. | | [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. | | [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. | | [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. | |||

|---|---|---|
| Known Indirect Subclasses [AbstractMethodError](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/AbstractMethodError.html), [ClassCircularityError](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ClassCircularityError.html), [ClassFormatError](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ClassFormatError.html), [ExceptionInInitializerError](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ExceptionInInitializerError.html), [GenericSignatureFormatError](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/reflect/GenericSignatureFormatError.html), [IllegalAccessError](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IllegalAccessError.html), [IncompatibleClassChangeError](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IncompatibleClassChangeError.html), [InstantiationError](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/InstantiationError.html), [InternalError](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/InternalError.html), [NoClassDefFoundError](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/NoClassDefFoundError.html), [NoSuchFieldError](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/NoSuchFieldError.html), [NoSuchMethodError](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/NoSuchMethodError.html), [OutOfMemoryError](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/OutOfMemoryError.html), [StackOverflowError](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/StackOverflowError.html), [UnknownError](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/UnknownError.html), [UnsatisfiedLinkError](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/UnsatisfiedLinkError.html), [UnsupportedClassVersionError](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/UnsupportedClassVersionError.html), [ZipError](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/ZipError.html) |---|---| | [AbstractMethodError](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/AbstractMethodError.html) | Thrown when an application tries to call an abstract method. | | [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. | | [ExceptionInInitializerError](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ExceptionInInitializerError.html) | Signals that an unexpected exception has occurred in a static initializer. | | [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. | | [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. | | [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. | | [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. | | [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. | | [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. | | [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. | | [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. | | [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. | | [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. | | [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. | | [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`. | | [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. | | [ZipError](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/ZipError.html) | Signals that an unrecoverable error has occurred. | |||

An `Error` is a subclass of `Throwable`
that indicates serious problems that a reasonable application
should not try to catch. Most such errors are abnormal conditions.
The `ThreadDeath` error, though a "normal" condition,
is also a subclass of `Error` because most applications
should not try to catch it.


A method is not required to declare in its `throws`
clause any subclasses of `Error` that might be thrown
during the execution of the method but not caught, since these
errors are abnormal conditions that should never occur.

That is, `Error` and its subclasses are regarded as unchecked
exceptions for the purposes of compile-time checking of exceptions.

##### See Also

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

### Public Constructor Summary

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

|---|---|
|   | [Error](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Error.html#Error(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 error with the specified detail message, cause, suppression enabled or disabled, and writable stack trace enabled or disabled. |

### Inherited Method Summary

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

|---|---|
| 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. |

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
**Error**
()

Constructs a new error 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)`.

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

Constructs a new error 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)`.

##### 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
**Error**
([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 error with the specified detail message and
cause.

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

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

Constructs a new error 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 errors that are little more than
wrappers for other throwables.

##### 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
**Error**
([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 error with the specified detail message,
cause, suppression enabled or disabled, and writable stack
trace enabled or disabled.

##### 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 |
|---|---|