Package org.fiware.mintaka.exception
Class CannotCreateTransactionExceptionHandler
java.lang.Object
org.fiware.mintaka.exception.NGSICompliantExceptionHandler<io.micronaut.transaction.exceptions.CannotCreateTransactionException>
org.fiware.mintaka.exception.CannotCreateTransactionExceptionHandler
- All Implemented Interfaces:
io.micronaut.http.server.exceptions.ExceptionHandler<io.micronaut.transaction.exceptions.CannotCreateTransactionException,
io.micronaut.http.HttpResponse<ProblemDetails>>
@Produces
@Singleton
@Requires(classes={io.micronaut.transaction.exceptions.CannotCreateTransactionException.class,io.micronaut.http.server.exceptions.ExceptionHandler.class})
public class CannotCreateTransactionExceptionHandler
extends NGSICompliantExceptionHandler<io.micronaut.transaction.exceptions.CannotCreateTransactionException>
Handler for mapping
CannotCreateTransactionException
. Provides the requested tenant as instance.-
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, io.micronaut.transaction.exceptions.CannotCreateTransactionException 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
-
CannotCreateTransactionExceptionHandler
public CannotCreateTransactionExceptionHandler()
-
-
Method Details
-
getAssociatedErrorType
Description copied from class:NGSICompliantExceptionHandler
Return theErrorType
associated with the concrete exception- Specified by:
getAssociatedErrorType
in classNGSICompliantExceptionHandler<io.micronaut.transaction.exceptions.CannotCreateTransactionException>
- 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<io.micronaut.transaction.exceptions.CannotCreateTransactionException>
- 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<io.micronaut.transaction.exceptions.CannotCreateTransactionException>
- Returns:
- the error title
-
getInstance
public String getInstance(io.micronaut.http.HttpRequest request, io.micronaut.transaction.exceptions.CannotCreateTransactionException exception) Description copied from class:NGSICompliantExceptionHandler
Id of an instance associated with the error.- Specified by:
getInstance
in classNGSICompliantExceptionHandler<io.micronaut.transaction.exceptions.CannotCreateTransactionException>
- Parameters:
request
- erroneous requestexception
- the concrete exception- Returns:
- the instance id, null if no such instance can be identified.
-