Package io.goobi.viewer.api.rest.model
Class ErrorMessage
java.lang.Object
io.goobi.viewer.api.rest.model.ErrorMessage
- All Implemented Interfaces:
IResponseMessage
REST API response model that carries an HTTP status code, a human-readable error description, and an optional stack trace.
Implements
IResponseMessage and is serialized as JSON for error responses.- Author:
- Florian Alpers
-
Constructor Summary
ConstructorsConstructorDescriptionErrorMessage(int status, String message) Creates a new ErrorMessage instance.ErrorMessage(int status, String message, String stackTrace) Creates a new ErrorMessage instance.ErrorMessage(RestApiException exception) Creates a new ErrorMessage instance. -
Method Summary
Modifier and TypeMethodDescriptionGetter for the fieldmessage.Getter for the fieldstackTrace.intGetter for the fieldstatus.
-
Constructor Details
-
ErrorMessage
public ErrorMessage() -
ErrorMessage
Creates a new ErrorMessage instance.- Parameters:
status- HTTP status code of the error responsemessage- human-readable error description
-
ErrorMessage
Creates a new ErrorMessage instance.- Parameters:
status- HTTP status code of the error responsemessage- human-readable error descriptionstackTrace- stack trace string for diagnostic purposes
-
ErrorMessage
Creates a new ErrorMessage instance.- Parameters:
exception- REST API exception carrying status code and message
-
-
Method Details
-
getStatus
public int getStatus()Getter for the fieldstatus.- Returns:
- the HTTP status code of this error response
-
getMessage
Getter for the fieldmessage.- Specified by:
getMessagein interfaceIResponseMessage- Returns:
- the human-readable error description
-
getStackTrace
Getter for the fieldstackTrace.- Returns:
- the stack trace string for diagnostic purposes, or null if not set
-