jooby
jooby copied to clipboard
problem throwing StatusCodeException when there's an error handler
In jooby 2.0.2, when I have an error handler, all the exceptions that are not "caught" by that handler make the request stall.
Here is a small example:
public class App extends Jooby
{
{
error(IllegalAccessException.class, ((ctx, cause, statusCode) -> {
ctx.setResponseCode(statusCode);
ctx.send(cause.getMessage());
}));
get("/test", ctx ->
something()
);
}
public String something() {
throw new StatusCodeException(StatusCode.UNAUTHORIZED, "test");
}
public static void main(String[] args) {
runApp(args, App::new);
}
}
If you make a request to /test, the connection stalles.