Closed szysas closed 4 years ago
Thanks for the bug report @szysas! You would expect it to instead return some kind of 4xx? It sounds like maybe the move would be to add something to the QueryStringDecoder to throw a more specific exception and then add something to the default exception mapper to catch that exception and turn it into the appropriate error code?
@szysas looks like this is happening before we can route the request which then doesn't trigger the exception mapping filter, the code blows up before executing the service wrapped with the filter. That's unfortunate. We'll take a look and see what we can do. Thanks for reporting.
@szysas the workaround is to ensure you add the ExceptionMappingFilter
with beforeRouting = true
, e.g.,
router
.filter(new ExceptionMappingFilter[Request](injector.instance[ExceptionManager]), beforeRouting = true)
We're looking at ways we could potentially help here but we're not likely to make this case configurable in that we'd most likely always return a 400 - BadRequest
in this instance.
👍
Expected behavior
Defined Exception mapper should catch and translate exception.
Actual behavior
Server returns 500 error and print stack traces in logs
Steps to reproduce the behavior
Finatra 19.6.0; HttpServer with simple configuration:
Make request with illegal URl request, for example
GET
/test/test%%