All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.techempower.gemini.path.RequestBodyException Maven / Gradle / Ivy

There is a newer version: 3.3.14
Show newest version
package com.techempower.gemini.path;

/**
 * An exception that should be thrown by implementations of
 * {@link RequestBodyAdapter} when something goes wrong. You
 * must provide an HTTP status code and message that will be
 * used to generate an error response to the user.
 */
public class RequestBodyException extends Exception
{
  private static final long serialVersionUID = 3381361290493468966L;
  private final int statusCode;

  public RequestBodyException(int statusCode, String message, Throwable cause)
  {
    super(message, cause);
    this.statusCode = statusCode;
  }

  public RequestBodyException(int statusCode, String message)
  {
    this(statusCode, message, null);
  }

  /**
   * The status code to set on the response.
   */
  public int getStatusCode()
  {
    return statusCode;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy