Re-organize internals of StandardExceptionMappers#register(ServerFactory, Environment) #481
Labels
code cleanup
Fix issues reported by Sonar or any other code analysis tools
Milestone
Since we originally added the
register
method, Dropwizard added moreExceptionMapper
implementations, for exampleIllegalStateExceptionMapper
. It has also removed other ones, for example it replaced the originalConstraintViolationExceptionMapper
in 1.0.0-rc1 withJerseyViolationExceptionMapper
.Since we began using Dropwizard at 0.7.0, these changes have made the internal code comments and organization in register somewhat incorrect.
This method should be re-organized and comments updated so that it first disables Dropwizard default exception mappers, then registers the kiwi exception mappers, and finally registers the replacements for the Dropwizard exception mappers. There is still some overlap since kiwi contains an
IllegalStateExceptionMapper
which, when registered, will replace the Dropwizard ones.And last, there are some newer Dropwizard exception mappers for which neither kiwi nor dropwizard-service-utilities contains a replacement, for example
EmptyOptionalNoContentExceptionMapper
indropwizard-jersey
andLoggingSQLExceptionMapper
,LoggingJdbiExceptionMapper
which live indropwizard-jdbi3
.The javadocs should provide a reference (via
@link
or@see
or both) to Dropwizard'sExceptionMapperBinder
class where it registers its default mappers. The docs should also reference Overriding Default Exception Mappers so the reader (and that includes me) can quickly figure out what is registered by us and by Dropwizard.The text was updated successfully, but these errors were encountered: