Package org.kiwiproject.jaxrs.exception
Class IllegalArgumentExceptionMapper
java.lang.Object
org.kiwiproject.jaxrs.exception.IllegalArgumentExceptionMapper
- All Implemented Interfaces:
jakarta.ws.rs.ext.ExceptionMapper<IllegalArgumentException>
@Provider
public class IllegalArgumentExceptionMapper
extends Object
implements jakarta.ws.rs.ext.ExceptionMapper<IllegalArgumentException>
Map
IllegalArgumentException to Response.
The mapped response has status code 400 (Bad Request) and media type JSON.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionjakarta.ws.rs.core.ResponsetoResponse(IllegalArgumentException exception) Convert the givenIllegalArgumentExceptionto a 400 Bad Request response containing a JSON entity.
-
Constructor Details
-
IllegalArgumentExceptionMapper
public IllegalArgumentExceptionMapper()
-
-
Method Details
-
toResponse
Convert the givenIllegalArgumentExceptionto a 400 Bad Request response containing a JSON entity.- Specified by:
toResponsein interfacejakarta.ws.rs.ext.ExceptionMapper<IllegalArgumentException>- Parameters:
exception- the exception to convert- Returns:
- a response
- See Also:
-