org.restlet.resource

## Class ResourceException

- java.lang.Object
- - java.lang.Throwable
  - - java.lang.Exception
    - - java.lang.RuntimeException
      - - org.restlet.resource.ResourceException

All Implemented Interfaces:
  java.io.Serializable

    public class ResourceException
    extends java.lang.RuntimeException

Encapsulates a response status and the optional cause as a checked exception.

Author:
  Jerome Louvel
See Also:
  Serialized Form

### Constructor Summary

Constructors
Constructor and Description
`ResourceException(int code)` Constructor.
`ResourceException(int code, java.lang.String name, java.lang.String description, java.lang.String uri)` Constructor.
`ResourceException(int code, java.lang.String name, java.lang.String description, java.lang.String uri, java.lang.Throwable cause)` Constructor.
`ResourceException(int code, java.lang.Throwable cause)` Constructor.
`ResourceException(Status status)` Constructor.
`ResourceException(Status status, java.lang.String description)` Constructor.
`ResourceException(Status status, java.lang.String description, java.lang.Throwable cause)` Constructor.
`ResourceException(Status status, java.lang.Throwable cause)` Constructor.
`ResourceException(java.lang.Throwable cause)` Constructor that set the status to `Status.SERVER_ERROR_INTERNAL` including the related error or exception.

### Method Summary

Methods
`Status` `getStatus()` Returns the status associated to this exception.
`java.lang.String` `toString()`

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

`addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace`

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

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

### Constructor Detail

#### ResourceException

    public ResourceException(int code)

Constructor.

Parameters:
  `code` - The specification code of the encapsulated status.

#### ResourceException

    public ResourceException(int code,
                     java.lang.String name,
                     java.lang.String description,
                     java.lang.String uri)

Constructor.

Parameters:
  `code` - The specification code of the encapsulated status.
  `name` - The name of the encapsulated status.
  `description` - The description of the encapsulated status.
  `uri` - The URI of the specification describing the method.

#### ResourceException

    public ResourceException(int code,
                     java.lang.String name,
                     java.lang.String description,
                     java.lang.String uri,
                     java.lang.Throwable cause)

Constructor.

Parameters:
  `code` - The specification code of the encapsulated status.
  `name` - The name of the encapsulated status.
  `description` - The description of the encapsulated status.
  `uri` - The URI of the specification describing the method.
  `cause` - The wrapped cause error or exception.

#### ResourceException

    public ResourceException(int code,
                     java.lang.Throwable cause)

Constructor.

Parameters:
  `code` - The specification code of the encapsulated status.
  `cause` - The wrapped cause error or exception.

#### ResourceException

    public ResourceException(Status status)

Constructor.

Parameters:
  `status` - The status to associate.

#### ResourceException

    public ResourceException(Status status,
                     java.lang.String description)

Constructor.

Parameters:
  `status` - The status to copy.
  `description` - The description of the encapsulated status.

#### ResourceException

    public ResourceException(Status status,
                     java.lang.String description,
                     java.lang.Throwable cause)

Constructor.

Parameters:
  `status` - The status to copy.
  `description` - The description of the encapsulated status.
  `cause` - The wrapped cause error or exception.

#### ResourceException

    public ResourceException(Status status,
                     java.lang.Throwable cause)

Constructor.

Parameters:
  `status` - The status to associate.
  `cause` - The wrapped cause error or exception.

#### ResourceException

    public ResourceException(java.lang.Throwable cause)

Constructor that set the status to `Status.SERVER_ERROR_INTERNAL` including the related error or exception.

Parameters:
  `cause` - The wrapped cause error or exception.

### Method Detail

#### getStatus

    public Status getStatus()

Returns the status associated to this exception.

Returns:
  The status associated to this exception.

#### toString

    public java.lang.String toString()

Overrides:
  `toString` in class `java.lang.Throwable`