DthingApi
Public Member Functions | List of all members
java.lang.Throwable Class Reference
Inheritance diagram for java.lang.Throwable:
java.lang.Error java.lang.Exception java.lang.AssertionError java.lang.LinkageError java.lang.VirtualMachineError java.lang.ClassNotFoundException java.lang.CloneNotSupportedException java.lang.IllegalAccessException java.lang.InstantiationException java.lang.InterruptedException java.lang.RuntimeException

Public Member Functions

 Throwable ()
 
 Throwable (String detailMessage)
 
String getMessage ()
 
String getLocalizedMessage ()
 
void printStackTrace ()
 
String toString ()
 

Detailed Description

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

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

can also include a cause, which is a nested

that represents the original problem that led to this

. It is often used for wrapping various types of errors into a common

without losing the detailed original error information. When printing the stack trace, the trace of the cause is included.

See also
Error
Exception
RuntimeException

Constructor & Destructor Documentation

◆ Throwable() [1/2]

java.lang.Throwable.Throwable ( )
inline

Constructs a new

that includes the current stack trace.

◆ Throwable() [2/2]

java.lang.Throwable.Throwable ( String  detailMessage)
inline

Constructs a new

with the current stack trace and the specified detail message.

Parameters
detailMessagethe detail message for this .

Member Function Documentation

◆ getLocalizedMessage()

String java.lang.Throwable.getLocalizedMessage ( )
inline

Returns the extra information message which was provided when this

was created. Returns

null

if no message was provided at creation time. Subclasses may override this method to return localized text for the message. Android returns the regular detail message.

Returns
this 's localized detail message.

◆ getMessage()

String java.lang.Throwable.getMessage ( )
inline

Returns the extra information message which was provided when this

was created. Returns

null

if no message was provided at creation time.

Returns
this 's detail message.

◆ printStackTrace()

void java.lang.Throwable.printStackTrace ( )
inline

Writes a printable representation of this

's stack trace to the

System.err

stream.

◆ toString()

String java.lang.Throwable.toString ( )
inline

Returns a short description of this throwable object. If this Throwable object was created with an error message string, then the result is the concatenation of three strings:

  • The name of the actual class of this object
  • ": " (a colon and a space)
  • The result of the getMessage method for this object

If this Throwable object was created with no error message string, then the name of the actual class of this object is returned.

Returns
a string representation of this Throwable.

The documentation for this class was generated from the following file: