Class JsonParseExceptionMapper
- java.lang.Object
-
- com.fasterxml.jackson.jakarta.rs.base.JsonParseExceptionMapper
-
- All Implemented Interfaces:
ExceptionMapper<JsonParseException>
public class JsonParseExceptionMapper extends Object implements ExceptionMapper<JsonParseException>
Implementation ofExceptionMapperto send down a "400 Bad Request" in the event unparsable JSON is received.
-
-
Constructor Summary
Constructors Constructor Description JsonParseExceptionMapper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ResponsetoResponse(JsonParseException exception)Map an exception to aResponse.
-
-
-
Method Detail
-
toResponse
public Response toResponse(JsonParseException exception)
Description copied from interface:ExceptionMapperMap an exception to aResponse. Returningnullresults in aResponse.Status.NO_CONTENTresponse. Throwing a runtime exception results in aResponse.Status.INTERNAL_SERVER_ERRORresponse.- Specified by:
toResponsein interfaceExceptionMapper<JsonParseException>- Parameters:
exception- the exception to map to a response.- Returns:
- a response mapped from the supplied exception.
-
-