Class ResourceRegistryException
java.lang.Object
java.lang.Throwable
java.lang.Exception
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
AlreadyPresentException,AvailableInAnotherContextException,ConcurrentWriteException,ContextException,CreationException,InvalidContextNameException,InvalidQueryException,InvalidUUIDException,IsParentOfException,NotFoundException,QueryTemplateException,SchemaException,SchemaViolationException,UUIDAlreadyInUseException
Base checked exception for every error condition raised by the Resource Registry
REST API. Annotated
@JsonTypeInfo so that the concrete subclass name travels
on the wire and the original type is restored client-side by ExceptionMapper.
Mapped to 500 Internal Server Error by the REST layer when thrown as this
exact class. Every subclass is mapped to a more specific HTTP status by the REST
layer's exception mapper (see the subclass Javadoc); a subclass with no explicit
mapping defaults to 400 Bad Request.
- Author:
- Luca Frosini (ISTI - CNR)
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionResourceRegistryException(String message) Instantiates a new resource registry exception.ResourceRegistryException(String message, Throwable cause) Instantiates a new resource registry exception.Instantiates a new resource registry exception. -
Method Summary
Modifier and TypeMethodDescriptionwithResponseMetadata(ResponseMetadata metadata) Attaches immutable HTTP metadata captured from the failed client request.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
ResourceRegistryException
Instantiates a new resource registry exception.- Parameters:
message- the message
-
ResourceRegistryException
Instantiates a new resource registry exception.- Parameters:
cause- the cause
-
ResourceRegistryException
Instantiates a new resource registry exception.- Parameters:
message- the messagecause- the cause
-
-
Method Details
-
withResponseMetadata
Attaches immutable HTTP metadata captured from the failed client request.- Parameters:
metadata- response metadata- Returns:
- this exception
-
getResponseMetadata
- Returns:
- metadata for the failed HTTP response, when this exception originated in a Java client
-