Class HttpServer.HttpException

  • All Implemented Interfaces:
    java.io.Serializable
    Enclosing class:
    HttpServer

    private static class HttpServer.HttpException
    extends java.io.IOException
    Convenience class for representing an error whose content should be returned to the user as an HTTP erro response of some kind.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int code_  
      private java.lang.String phrase_  
    • Constructor Summary

      Constructors 
      Constructor Description
      HttpException​(int code, java.lang.String phrase)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) HttpServer.Response createResponse()
      Turns this exception into a response object.
      • 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
    • Field Detail

      • code_

        private final int code_
      • phrase_

        private final java.lang.String phrase_
    • Constructor Detail

      • HttpException

        HttpException​(int code,
                      java.lang.String phrase)
        Constructor.
        Parameters:
        code - 3-digit status code
        phrase - status phrase
    • Method Detail

      • createResponse

        HttpServer.Response createResponse()
        Turns this exception into a response object.
        Returns:
        error response