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
public class ResourceRegistryException extends Exception
Base checked exception for every error condition raised by the Resource Registry REST API. Annotated@JsonTypeInfoso that the concrete subclass name travels on the wire and the original type is restored client-side byExceptionMapper.Mapped to
500 Internal Server Errorby 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 to400 Bad Request.- Author:
- Luca Frosini (ISTI - CNR)
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ResourceRegistryException(String message)Instantiates a new resource registry exception.ResourceRegistryException(String message, Throwable cause)Instantiates a new resource registry exception.ResourceRegistryException(Throwable cause)Instantiates a new resource registry exception.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<ResponseMetadata>getResponseMetadata()ResourceRegistryExceptionwithResponseMetadata(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 Detail
-
ResourceRegistryException
public ResourceRegistryException(String message)
Instantiates a new resource registry exception.- Parameters:
message- the message
-
ResourceRegistryException
public ResourceRegistryException(Throwable cause)
Instantiates a new resource registry exception.- Parameters:
cause- the cause
-
-
Method Detail
-
withResponseMetadata
public ResourceRegistryException withResponseMetadata(ResponseMetadata metadata)
Attaches immutable HTTP metadata captured from the failed client request.- Parameters:
metadata- response metadata- Returns:
- this exception
-
getResponseMetadata
public Optional<ResponseMetadata> getResponseMetadata()
- Returns:
- metadata for the failed HTTP response, when this exception originated in a Java client
-
-