Class HttpStatusException

  • All Implemented Interfaces:
    java.io.Serializable

    public class HttpStatusException
    extends HttpException
    Exception thrown to return an specific HttpStatus and an error message.
    Since:
    1.0
    See Also:
    Serialized Form
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Optional<java.lang.Object> getBody()  
      HttpStatus getStatus()  
      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, 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

      • HttpStatusException

        public HttpStatusException​(HttpStatus status,
                                   java.lang.String message)
        Parameters:
        status - The HttpStatus
        message - The message
      • HttpStatusException

        public HttpStatusException​(HttpStatus status,
                                   java.lang.Object body)
        Parameters:
        status - The HttpStatus
        body - The arbitrary object to return
    • Method Detail

      • getBody

        public java.util.Optional<java.lang.Object> getBody()
        Returns:
        The optional body for the response