All Downloads are FREE. Search and download functionalities are using the official Maven repository.

athenz.shade.zts.org.glassfish.jersey.jackson.internal.jackson.jaxrs.base.JsonParseExceptionMapper Maven / Gradle / Ivy

There is a newer version: 1.11.59
Show newest version
package athenz.shade.zts.athenz.shade.zts.org.glassfish.jersey.jackson.internal.jackson.jaxrs.base;
import athenz.shade.zts.athenz.shade.zts.com.fasterxml.jackson.core.JsonParseException;

import athenz.shade.zts.athenz.shade.zts.javax.ws.rs.core.Response;
import athenz.shade.zts.athenz.shade.zts.javax.ws.rs.ext.ExceptionMapper;

/**
 * Implementation of {@link ExceptionMapper} to send down a "400 Bad Request"
 * in the event unparsable JSON is received.
 *

* Note that {@link athenz.shade.zts.athenz.shade.zts.javax.ws.rs.ext.Provider} annotation was include up to * Jackson 2.7, but removed from 2.8 (as per [jaxrs-providers#22] * * @since 2.2 */ public class JsonParseExceptionMapper implements ExceptionMapper { @Override public Response toResponse(JsonParseException exception) { return Response.status(Response.Status.BAD_REQUEST).entity(exception.getMessage()).type("text/plain").build(); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy