io.dropwizard.jersey.errors.LoggingExceptionMapper Java Examples

The following examples show how to use io.dropwizard.jersey.errors.LoggingExceptionMapper. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: UncheckedExecutionExceptionMapper.java    From emodb with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings("unchecked")
@Override
public Response toResponse(UncheckedExecutionException e) {
    ExceptionMapper mapper = _providers.getExceptionMapper(e.getCause().getClass());
    if (mapper == null) {
        return null;
    } else if (mapper instanceof LoggingExceptionMapper) {
        return mapper.toResponse(e);
    } else {
        return mapper.toResponse(e.getCause());
    }
}
 
Example #2
Source File: ExceptionMapperBinder.java    From robe with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
    protected void configure() {
        bind(new LoggingExceptionMapper<Throwable>() {
        }).to(ExceptionMapper.class);
        bind(new JerseyViolationExceptionMapper()).to(ExceptionMapper.class);
        bind(new JsonProcessingExceptionMapper(isShowDetails())).to(ExceptionMapper.class);
        bind(new EarlyEofExceptionMapper()).to(ExceptionMapper.class);
//        bind(new EmptyOptionalExceptionMapper()).to(ExceptionMapper.class);
    }