Class RestApiException

java.lang.Object
java.lang.Throwable
java.lang.Exception
io.goobi.viewer.exceptions.RestApiException
All Implemented Interfaces:
Serializable

public class RestApiException extends Exception
Thrown when an error occurs during REST API request processing, carrying an associated HTTP status code.
Author:
Florian Alpers
See Also:
  • Constructor Details

    • RestApiException

      public RestApiException(int statusCode)
      Creates a new RestApiException instance.
      Parameters:
      statusCode - HTTP status code of the failed API response
    • RestApiException

      public RestApiException(String message, Throwable cause, int statusCode)
      Creates a new RestApiException instance.
      Parameters:
      message - human-readable error description
      cause - underlying exception that triggered this error
      statusCode - HTTP status code of the failed API response
    • RestApiException

      public RestApiException(String message, Throwable cause, Response.Status status)
    • RestApiException

      public RestApiException(String message, int statusCode)
      Creates a new RestApiException instance.
      Parameters:
      message - human-readable error description
      statusCode - HTTP status code of the failed API response
    • RestApiException

      public RestApiException(String message, Response.Status status)
    • RestApiException

      public RestApiException(Throwable cause, int statusCode)
      Creates a new RestApiException instance.
      Parameters:
      cause - underlying exception that triggered this error
      statusCode - HTTP status code of the failed API response
    • RestApiException

      public RestApiException(Throwable cause, Response.Status status)
  • Method Details

    • getStatusCode

      public int getStatusCode()
      Getter for the field statusCode.
      Returns:
      the HTTP status code associated with this REST API exception
    • getStatus

      public Response.Status getStatus()