Android Guides | Samples

Java.Lang.Throwable Class

The superclass of all classes which can be thrown by the VM.

See Also: Throwable

Syntax

[Android.Runtime.Register("java/lang/Throwable", DoNotGenerateAcw=true)]
public class Throwable : Exception, IJavaObjectEx, ISerializable, IDisposable

Remarks

The superclass of all classes which can be thrown by the VM. The two direct subclasses are recoverable exceptions (Exception) and unrecoverable errors (Error). This class provides common methods for accessing a string message which provides extra information about the circumstances in which the Throwable was created (basically an error message in most cases), and for saving a stack trace (that is, a record of the call stack at a particular point in time) which can be printed later.

A Throwable can also include a cause, which is a nested Throwable that represents the original problem that led to this Throwable. It is often used for wrapping various types of errors into a common Throwable without losing the detailed original error information. When printing the stack trace, the trace of the cause is included.

See Also

[Android Documentation]

Requirements

Namespace: Java.Lang
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1

The members of Java.Lang.Throwable are listed below.

See Also: Exception

Public Constructors

Constructs a new Throwable that includes the current stack trace.
Constructs a new Throwable with the current stack trace and the given cause.
Constructs a new Throwable with the current stack trace and the given detail message.
A constructor used when creating managed representations of JNI objects; called by the runtime.
Constructs a new Throwable with the current stack trace, the given detail message and cause.

Protected Constructors

Constructs a new Throwable with the current stack trace, the specified detail message and the specified cause.

Protected Fields

Public Properties

[read-only]
CauseThrowable. Returns the cause of this Throwable, or null if there is no cause.
[read-only]
ClassClass.
[read-only]
HandleIntPtr. The handle to the underlying Android instance.
[read-only]
LocalizedMessageString. Returns the detail message which was provided when this Throwable was created.
[read-only]
MessageString. Returns the detail message which was provided when this Throwable was created.
[read-only]
override
StackTraceString.

Protected Properties

[read-only]
ThresholdClassIntPtr. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.
[read-only]
ThresholdTypeType. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Public Methods

AddSuppressed(Throwable)
Adds throwable to the list of throwables suppressed by this.
Dispose()
FillInStackTrace() : Throwable
Records the stack trace from the point where this method has been called to this Throwable.
Finalize()
static
FromException(Exception) : Throwable
Converts a Exception into a Throwable.
GetStackTrace() : StackTraceElement[]
Returns a clone of the array of stack trace elements of this Throwable.
GetSuppressed() : Throwable[]
Returns the throwables suppressed by this.
InitCause(Throwable) : Throwable
Initializes the cause of this Throwable.
PrintStackTrace()
Writes a printable representation of this Throwable's stack trace to the System.err stream.
PrintStackTrace(PrintStream)
Writes a printable representation of this Throwable's stack trace to the given print stream.
PrintStackTrace(PrintWriter)
Writes a printable representation of this Throwable's stack trace to the specified print writer.
SetStackTrace(StackTraceElement[])
Sets the array of stack trace elements.
static
ToException(Throwable) : Exception

Protected Methods

Explicitly Implemented Interface Members