Class HttpHandleException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
eu.cloudnetservice.driver.network.http.HttpHandleException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
AnnotationHttpHandleException

public class HttpHandleException extends RuntimeException
An exception which can be thrown by a handler to set the status and body of the response for the current http request. Throwing this exception will not prevent other handlers from processing the request as well.
Since:
4.0
See Also:
  • Field Details

    • responseBody

      private final byte[] responseBody
    • responseCode

      private final HttpResponseCode responseCode
  • Constructor Details

    • HttpHandleException

      public HttpHandleException(@NonNull @NonNull HttpResponseCode responseCode, byte[] responseBody, @NonNull @NonNull String message)
      Constructs a new HttpHandleException instance.
      Parameters:
      responseCode - the http status code to set in the response.
      responseBody - the response body to set, null to reset the body.
      message - the detail message why the exception occurred, for debugging only.
      Throws:
      NullPointerException - if the given response code or message is null.
  • Method Details