public final class RemoteWrappedException extends ConnectorException
String stackTrace = null;
try {
try {
facade.getObject(ObjectClass.ACCOUNT, uid, null);
} catch (RemoteWrappedException e) {
stackTrace = e.getStackTrace()
}
} catch (Throwable t) {
if (null != stackTrace) {
System.err.println(stackTrace);
} else {
t.printStackTrace();
}
}
Modifier and Type | Field and Description |
---|---|
static String |
FIELD_CAUSE |
static String |
FIELD_CLASS |
static String |
FIELD_MESSAGE |
static String |
FIELD_STACK_TRACE |
Constructor and Description |
---|
RemoteWrappedException(String throwableClass,
String message,
RemoteWrappedException cause,
String stackTrace) |
Modifier and Type | Method and Description |
---|---|
static HashMap<String,Object> |
convert(Throwable throwable)
Converts the throwable object to a new Map object that representing
itself.
|
RemoteWrappedException |
getCause()
Returns the cause of original throwable or
null if the cause is
nonexistent or unknown. |
String |
getExceptionClass()
Gets the class name of the original exception.
|
static String |
getStackTrace(Throwable throwable)
Gets the stack trace from a Throwable as a String.
|
boolean |
is(Class<? extends Throwable> expected)
Checks if the exception is the expected class.
|
void |
printStackTrace(PrintStream s) |
void |
printStackTrace(PrintWriter s) |
String |
readStackTrace() |
static RemoteWrappedException |
wrap(Throwable ex)
Wraps the Throwable into a RemoteWrappedException instance.
|
rethrow
addSuppressed, fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, setStackTrace, toString
public static final String FIELD_CLASS
public static final String FIELD_MESSAGE
public static final String FIELD_CAUSE
public static final String FIELD_STACK_TRACE
public RemoteWrappedException(String throwableClass, String message, RemoteWrappedException cause, String stackTrace)
public String getExceptionClass()
throwable.getClass().getName()
.public boolean is(Class<? extends Throwable> expected)
expected
- the expected throwable class.true
if the class name are equals.public RemoteWrappedException getCause()
null
if the cause is
nonexistent or unknown. (The cause is the throwable that caused the
original throwable to get thrown.)public void printStackTrace(PrintStream s)
printStackTrace
in class Throwable
public void printStackTrace(PrintWriter s)
printStackTrace
in class Throwable
public String readStackTrace()
public static String getStackTrace(Throwable throwable)
throwable
- the Throwable
to be examinedprintStackTrace(PrintWriter)
methodpublic static RemoteWrappedException wrap(Throwable ex)
ex
- Exception to wrap or cast and return.RemoteWrappedException
that either is the
specified exception or contains the specified exception.Copyright © 2019. All rights reserved.