org.eclipse.cdt.core.model

## Class CModelException

- java.lang.Object
- - CoreException
  - - org.eclipse.cdt.core.model.CModelException

    public class CModelException
    extends 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:
  `ICModelStatus`, `ICModelStatusConstants`

### Constructor Summary

Constructors
Constructor and Description
`CModelException(CoreException exception)` Creates a C model exception for the given `CoreException`.
`CModelException(java.lang.Throwable e, int code)` Creates a C model exception that wrappers the given `Throwable`.

### Method Summary

All Methods Instance Methods Concrete Methods
`boolean` `doesNotExist()` Returns whether this exception indicates that a C model element does not exist.
`ICModelStatus` `getCModelStatus()` Returns the C model status object for this exception.
`java.lang.Throwable` `getException()` Returns the underlying `Throwable` that caused the failure.
`java.lang.String` `toString()` Returns a printable representation of this exception suitable for debugging purposes only.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### CModelException

    public CModelException(java.lang.Throwable e,
                           int code)

Creates a C model exception that wrappers the given `Throwable`. The exception contains a C-specific status object with severity `IStatus.ERROR` and the given status code.

Parameters:
  `e` - the `Throwable`
  `code` - one of the C-specific status codes declared in `ICModelStatusConstants`
See Also:
  `ICModelStatusConstants`, `org.eclipse.core.runtime.IStatus#ERROR`

#### CModelException

    public CModelException(CoreException exception)

Creates a C model exception for the given `CoreException`. Equivalent to `CModelException(exception,ICModelStatusConstants.CORE_EXCEPTION`.

Parameters:
  `exception` - the `CoreException`

### Method Detail

#### getException

    public java.lang.Throwable getException()

Returns the underlying `Throwable` that caused the failure.

Returns:
  the wrapped `Throwable`, or `null` if the direct case of the failure was at the C model layer

#### getCModelStatus

    public ICModelStatus 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 of `ICModelStatusConstants.ELEMENT_DOES_NOT_EXIST`. This is a convenience method.

Returns:
  `true` if this exception indicates that a C model element does not exist
See Also:
  `ICModelStatus.doesNotExist()`, `ICModelStatusConstants.ELEMENT_DOES_NOT_EXIST`

#### toString

    public java.lang.String toString()

Returns a printable representation of this exception suitable for debugging purposes only.