Class HttpErrorResponse


public class HttpErrorResponse extends HttpStringResponse
Response sent to client after an error.
Author:
Dr Michael Gardiner
  • Constructor Details

    • HttpErrorResponse

      public HttpErrorResponse(int code, String info)
      Returns an error code and simple error page to the client.
      Parameters:
      code - HTTP error code
      info - Information about the error
    • HttpErrorResponse

      public HttpErrorResponse(int code, String info, Throwable t)
      Returns an error code and simple error page including stack trace to the client.
      Parameters:
      code - HTTP error code
      info - Information about the error
      t - Exception to use to build stack trace.
    • HttpErrorResponse

      public HttpErrorResponse(HttpRequest httpReq, int code, String info)
      Returns an error code and simple error page including stack trace to the client.
      Parameters:
      httpReq - The HTTP request that caused the error.
      code - HTTP error code
      info - Information about the error
    • HttpErrorResponse

      public HttpErrorResponse(HttpRequest httpReq, int code, String info, String details)
      Returns an error code and simple error page including stack trace to the client.
      Parameters:
      httpReq - The HTTP request that caused the error.
      code - HTTP error code
      info - Information about the error
      details - Additional details about the error.
    • HttpErrorResponse

      public HttpErrorResponse(HttpRequest httpReq, int code, String info, Throwable t)
      Returns an error code and simple error page including stack trace to the client.
      Parameters:
      httpReq - The HTTP request that caused the error.
      code - HTTP error code
      info - Information about the error
      t - Exception to use to display stack trace.
    • HttpErrorResponse

      public HttpErrorResponse(HttpRequest httpReq, int code, String info, String details, Throwable t)
      Returns an error code and simple error page including stack trace to the client.
      Parameters:
      httpReq - The HTTP request that caused the error.
      code - HTTP error code
      info - Information about the error
      details - Additional details about the error.
      t - Exception to use to display stack trace.
    • HttpErrorResponse

      public HttpErrorResponse(HttpRequest httpReq, HttpResponse httpRes, int code, String info, String details, Throwable t)
      Returns an error code and simple error page including stack trace to the client.
      Parameters:
      httpReq - The HTTP request that caused the error.
      httpRes - The HTTP response that caused the error.
      code - HTTP error code
      info - Information about the error
      details - Additional details about the error.
      t - Exception to use to display stack trace.