@Provider public class JsonMappingExceptionMapper extends Object implements ExceptionMapper<JsonMappingException>
ExceptionMapper
to send down a "400 Bad Request"
response in the event that unmappable JSON is received.Constructor and Description |
---|
JsonMappingExceptionMapper() |
Modifier and Type | Method and Description |
---|---|
Response |
toResponse(JsonMappingException exception)
Map an exception to a
Response . |
public Response toResponse(JsonMappingException exception)
ExceptionMapper
Response
. 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<JsonMappingException>
exception
- the exception to map to a response.Copyright © 2016 JBoss by Red Hat. All rights reserved.