public class JsonParseExceptionMapper extends Object implements ExceptionMapper<JsonParseException>
ExceptionMapper to send down a "400 Bad Request"
in the event unparsable JSON is received.
Note that Provider annotation was include up to
Jackson 2.7, but removed from 2.8 (as per [jaxrs-providers#22]
| Constructor and Description |
|---|
JsonParseExceptionMapper() |
| Modifier and Type | Method and Description |
|---|---|
Response |
toResponse(JsonParseException exception)
Map an exception to a
Response. |
public Response toResponse(JsonParseException exception)
ExceptionMapperResponse. Returning
null results in a Response.Status.NO_CONTENT
response. Throwing a runtime exception results in a
Response.Status.INTERNAL_SERVER_ERROR response.toResponse in interface ExceptionMapper<JsonParseException>exception - the exception to map to a response.Copyright © 2017 JBoss by Red Hat. All rights reserved.