exception information, including the exception type and text, to a string.
Syntax
String toString()
Parameters
Notes
The toString() method formats the exception information for the current exception as follows:
exceptionType: messageText
In the line above, exceptionType is the exception object's exception type and messageText is its exception text.
Examples
The following example writes the current exception information to the String variable newmessage:
String newmessage = currentException.toString();