Example usage for com.fasterxml.jackson.databind JsonMappingException printStackTrace

List of usage examples for com.fasterxml.jackson.databind JsonMappingException printStackTrace

Introduction

In this page you can find the example usage for com.fasterxml.jackson.databind JsonMappingException printStackTrace.

Prototype

public void printStackTrace(PrintStream s) 

Source Link

Document

Prints this throwable and its backtrace to the specified print stream.

Usage

From source file:org.jaqpot.core.service.filter.excmappers.JsonMappingExceptionMapper.java

@Override
public Response toResponse(JsonMappingException exception) {
    LOG.log(Level.INFO, "JaqpotNotAuthorizedExceptionMapper exception caught", exception);
    StringWriter sw = new StringWriter();
    exception.printStackTrace(new PrintWriter(sw));
    String details = sw.toString();
    ErrorReport error = ErrorReportBuilder.builderRandomId().setCode("JsonMappingError")
            .setMessage(exception.getMessage()).setDetails(details).setHttpStatus(400).build();
    return Response.ok(error, MediaType.APPLICATION_JSON).status(Response.Status.BAD_REQUEST).build();
}