Package org.eclipse.cdt.core.model
Class CModelException
java.lang.Object
java.lang.Throwable
java.lang.Exception
org.eclipse.core.runtime.CoreException
org.eclipse.cdt.core.model.CModelException
- All Implemented Interfaces:
Serializable
public class CModelException
extends org.eclipse.core.runtime.CoreException
A checked exception representing a failure in the C model.
C model exceptions contain a C-specific status object describing the
cause of the exception.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCModelException(Throwable e, int code) Creates a C model exception that wrappers the givenThrowable.CModelException(ICModelStatus status) Creates a C model exception for the given C-specific status object.CModelException(org.eclipse.core.runtime.CoreException exception) Creates a C model exception for the givenCoreException. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns whether this exception indicates that a C model element does not exist.Returns the C model status object for this exception.Returns the underlyingThrowablethat caused the failure.toString()Returns a printable representation of this exception suitable for debugging purposes only.Methods inherited from class org.eclipse.core.runtime.CoreException
getCause, getStatus, printStackTrace, printStackTrace, printStackTraceMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, setStackTrace
-
Constructor Details
-
CModelException
Creates a C model exception that wrappers the givenThrowable. The exception contains a C-specific status object with severityIStatus.ERRORand the given status code.- Parameters:
e- theThrowablecode- one of the C-specific status codes declared inICModelStatusConstants- See Also:
-
CModelException
public CModelException(org.eclipse.core.runtime.CoreException exception) Creates a C model exception for the givenCoreException. Equivalent toCModelException(exception,ICModelStatusConstants.CORE_EXCEPTION.- Parameters:
exception- theCoreException
-
CModelException
Creates a C model exception for the given C-specific status object.- Parameters:
status- the C-specific status object
-
-
Method Details
-
getException
Returns the underlyingThrowablethat caused the failure.- Returns:
- the wrapped
Throwable, ornullif the direct case of the failure was at the C model layer
-
getCModelStatus
Returns the C model status object for this exception. Equivalent to(ICModelStatus) getStatus().- Returns:
- a status object
-
doesNotExist
public boolean doesNotExist()Returns whether this exception indicates that a C model element does not exist. Such exceptions have a status with a code ofICModelStatusConstants.ELEMENT_DOES_NOT_EXIST. This is a convenience method.- Returns:
trueif this exception indicates that a C model element does not exist- See Also:
-
toString
Returns a printable representation of this exception suitable for debugging purposes only.
-