Class RestException

All Implemented Interfaces:
Serializable
Direct Known Subclasses:
InvalidParameterException, ResourceNotFoundException, UnauthorizedUserException

public class RestException extends RuntimeException
Base class for exceptions thrown by the REST API. Encapsultes the HTTP status code that should be returned when an exception of this type occurs. The exception message should be suitable for display to the end user.
Since:
9.6
Author:
Voicu Moldovan
See Also:
  • Constructor Details Link icon

    • RestException Link icon

      public RestException(String message)
    • RestException Link icon

      public RestException(String message, Throwable cause)
    • RestException Link icon

      protected RestException(String message, int statusCode)
      Constructor meant for subclasses, which can specify the associated HTTP status code.
      Parameters:
      message - the error message
      statusCode - the HTTP status code
    • RestException Link icon

      protected RestException(String message, Throwable cause, int statusCode)
      Constructor meant for subclasses, which can specify the associated HTTP status code.
      Parameters:
      message - the error message
      cause - the wrapped exception
      statusCode - the HTTP status code
  • Method Details Link icon

    • getStatusCode Link icon

      public int getStatusCode()
      Returns:
      the HTTP status code for this exception