Class RESTException

  • All Implemented Interfaces:
    java.io.Serializable

    @API
    public class RESTException
    extends java.lang.RuntimeException
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      RESTException​(int status, java.lang.String message, java.lang.String contentType)
      Constructs an instance of RESTException with the specified status code, message and content type.
      RESTException​(java.lang.String msg)
      Constructs an instance of RESTException with the specified plain text message.
      RESTException​(java.lang.String msg, java.lang.Throwable cause)
      Constructs an instance of RESTException with the specified plain text message.
      RESTException​(java.lang.Throwable cause)
      Constructs an instance of RESTException with the specified cause.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getContentType()
      Returns the content type.
      java.lang.String getMessage()  
      java.lang.Integer getStatus()
      Returns the HTTP status code.
      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • RESTException

        public RESTException​(java.lang.String msg)
        Constructs an instance of RESTException with the specified plain text message.
        Parameters:
        msg - a plain text message
      • RESTException

        public RESTException​(java.lang.String msg,
                             java.lang.Throwable cause)
        Constructs an instance of RESTException with the specified plain text message.
        Parameters:
        msg - a plain text message
        cause - an exception indicating the cause of error
      • RESTException

        public RESTException​(java.lang.Throwable cause)
        Constructs an instance of RESTException with the specified cause.
        Parameters:
        cause - an exception indicating the cause of error
      • RESTException

        public RESTException​(int status,
                             java.lang.String message,
                             java.lang.String contentType)
        Constructs an instance of RESTException with the specified status code, message and content type.
        Parameters:
        status - an HTTP status code
        message - an error message
        contentType - a content type.
    • Method Detail

      • getStatus

        public java.lang.Integer getStatus()
        Returns the HTTP status code.
        Returns:
        a HTTP status code
      • getMessage

        public java.lang.String getMessage()
        Overrides:
        getMessage in class java.lang.Throwable
      • getContentType

        public java.lang.String getContentType()
        Returns the content type.
        Returns:
        a content type