Package org.fiware.mintaka.exception
Class PersistenceRetrievalExceptionHandler
java.lang.Object
org.fiware.mintaka.exception.NGSICompliantExceptionHandler<PersistenceRetrievalException>
org.fiware.mintaka.exception.PersistenceRetrievalExceptionHandler
- All Implemented Interfaces:
io.micronaut.http.server.exceptions.ExceptionHandler<PersistenceRetrievalException,
io.micronaut.http.HttpResponse<ProblemDetails>>
@Produces
@Singleton
@Requires(classes={PersistenceRetrievalException.class,io.micronaut.http.server.exceptions.ExceptionHandler.class})
public class PersistenceRetrievalExceptionHandler
extends NGSICompliantExceptionHandler<PersistenceRetrievalException>
Handle all
PersistenceRetrievalException
and map them to an internal error.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturn theErrorType
associated with the concrete exceptionReturn the error title to be used in the problem detailsgetInstance
(io.micronaut.http.HttpRequest request, PersistenceRetrievalException exception) Id of an instance associated with the error.io.micronaut.http.HttpStatus
Return the http status associated with the exceptionMethods inherited from class org.fiware.mintaka.exception.NGSICompliantExceptionHandler
handle
-
Constructor Details
-
PersistenceRetrievalExceptionHandler
public PersistenceRetrievalExceptionHandler()
-
-
Method Details
-
getAssociatedErrorType
Description copied from class:NGSICompliantExceptionHandler
Return theErrorType
associated with the concrete exception- Specified by:
getAssociatedErrorType
in classNGSICompliantExceptionHandler<PersistenceRetrievalException>
- Returns:
- the error-type
-
getStatus
public io.micronaut.http.HttpStatus getStatus()Description copied from class:NGSICompliantExceptionHandler
Return the http status associated with the exception- Specified by:
getStatus
in classNGSICompliantExceptionHandler<PersistenceRetrievalException>
- Returns:
- the http status
-
getErrorTitle
Description copied from class:NGSICompliantExceptionHandler
Return the error title to be used in the problem details- Specified by:
getErrorTitle
in classNGSICompliantExceptionHandler<PersistenceRetrievalException>
- Returns:
- the error title
-
getInstance
public String getInstance(io.micronaut.http.HttpRequest request, PersistenceRetrievalException exception) Description copied from class:NGSICompliantExceptionHandler
Id of an instance associated with the error.- Specified by:
getInstance
in classNGSICompliantExceptionHandler<PersistenceRetrievalException>
- Parameters:
request
- erroneous requestexception
- the concrete exception- Returns:
- the instance id, null if no such instance can be identified.
-