Package org.fiware.mintaka.exception
Class NGSICompliantExceptionHandler<T extends Throwable>
java.lang.Object
org.fiware.mintaka.exception.NGSICompliantExceptionHandler<T>
- Type Parameters:
T
- exception type, extendsThrowable
- All Implemented Interfaces:
io.micronaut.http.server.exceptions.ExceptionHandler<T,
io.micronaut.http.HttpResponse<ProblemDetails>>
- Direct Known Subclasses:
AttributeExpansionExceptionHandler
,CannotCreateTransactionExceptionHandler
,ContextRetrievalExceptionHandler
,IllegalArgumentsExceptionHandler
,InvalidTimeRelationExceptionHandler
,JacksonConversionExceptionHandler
,PersistenceRetrievalExceptionHandler
public abstract class NGSICompliantExceptionHandler<T extends Throwable>
extends Object
implements io.micronaut.http.server.exceptions.ExceptionHandler<T,io.micronaut.http.HttpResponse<ProblemDetails>>
Base exception handler to produce NGSI-LD compliant http responses.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract ErrorType
Return theErrorType
associated with the concrete exceptionabstract String
Return the error title to be used in the problem detailsabstract String
getInstance
(io.micronaut.http.HttpRequest request, T exception) Id of an instance associated with the error.abstract io.micronaut.http.HttpStatus
Return the http status associated with the exceptionio.micronaut.http.HttpResponse<ProblemDetails>
-
Constructor Details
-
NGSICompliantExceptionHandler
public NGSICompliantExceptionHandler()
-
-
Method Details
-
handle
public io.micronaut.http.HttpResponse<ProblemDetails> handle(io.micronaut.http.HttpRequest request, T exception) - Specified by:
handle
in interfaceio.micronaut.http.server.exceptions.ExceptionHandler<T extends Throwable,
io.micronaut.http.HttpResponse<ProblemDetails>>
-
getAssociatedErrorType
Return theErrorType
associated with the concrete exception- Returns:
- the error-type
-
getStatus
public abstract io.micronaut.http.HttpStatus getStatus()Return the http status associated with the exception- Returns:
- the http status
-
getErrorTitle
Return the error title to be used in the problem details- Returns:
- the error title
-
getInstance
Id of an instance associated with the error.- Parameters:
request
- erroneous requestexception
- the concrete exception- Returns:
- the instance id, null if no such instance can be identified.
-