org.deeplearning4j.ui.exception.JsonExceptionMapper Maven / Gradle / Ivy
package org.deeplearning4j.ui.exception;
import com.fasterxml.jackson.core.JsonProcessingException;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.ext.ExceptionMapper;
import javax.ws.rs.ext.Provider;
/**
* @author Adam Gibson
*/
@Provider
public class JsonExceptionMapper implements ExceptionMapper {
@Override
public Response toResponse(JsonProcessingException exception) {
return Response.status(500)
.entity("WTF")
.type(MediaType.APPLICATION_JSON)
.build();
}
}