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