public class CoreException extends Exception
Core exceptions contain a status object describing the cause of the exception.
This class can be used without OSGi running.
IStatus
,
Serialized FormConstructor and Description |
---|
CoreException(IStatus status)
Creates a new exception with the given status object.
|
Modifier and Type | Method and Description |
---|---|
Throwable |
getCause()
Returns the cause of this exception, or
null if none. |
IStatus |
getStatus()
Returns the status object for this exception.
|
void |
printStackTrace()
Prints a stack trace out for the exception, and
any nested exception that it may have embedded in
its Status object.
|
void |
printStackTrace(PrintStream output)
Prints a stack trace out for the exception, and
any nested exception that it may have embedded in
its Status object.
|
void |
printStackTrace(PrintWriter output)
Prints a stack trace out for the exception, and
any nested exception that it may have embedded in
its Status object.
|
addSuppressed, fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, setStackTrace, toString
public CoreException(IStatus status)
status
- the status object to be associated with this exceptionpublic Throwable getCause()
null
if none.public final IStatus getStatus()
IMPORTANT:
The result must NOT be used for logging, error reporting, or as a method
return value, since that code pattern hides the original stack trace. Instead,
create a new Status
with your plug-in ID and this
CoreException
, and use that new status for error reporting
or as a method return value. For example, instead of:
yourPlugin.getLog().log(exception.getStatus());Use:
IStatus result = new Status(exception.getStatus().getSeverity(), pluginId, message, exception); yourPlugin.getLog().log(result);
public void printStackTrace()
printStackTrace
in class Throwable
public void printStackTrace(PrintStream output)
printStackTrace
in class Throwable
output
- the stream to write topublic void printStackTrace(PrintWriter output)
printStackTrace
in class Throwable
output
- the stream to write to
Copyright (c) 2000, 2015 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.