@Provider public class JsonParseExceptionMapper extends Object implements ExceptionMapper<JsonParseException>
ExceptionMapper
to send down a "400 Bad Request"
in the event unparsable JSON is received.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)
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<JsonParseException>
exception
- the exception to map to a response.Copyright © 2016 JBoss by Red Hat. All rights reserved.