Dumping bad requests
问题 I have a service implemented with Dropwizard and I need to dump incorrect requests somewhere. I saw that there is a possibility to customise the error message by registering ExceptionMapper<JerseyViolationException> . But I need to have the complete request (headers, body) and not only ConstraintViolations . 回答1: You can inject ContainerRequest into the ExceptionMapper . You need to inject it as a javax.inject.Provider though, so that you can lazily retrieve it. Otherwise you will run into