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

org.deeplearning4j.ui.exception.JsonExceptionMapper Maven / Gradle / Ivy

There is a newer version: 1.0.0-beta5
Show newest version
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();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy