public static interface Err.Handler
Err.DefHandler
.Modifier and Type | Method and Description |
---|---|
void |
handle(Request req,
Response rsp,
Err ex)
Handle a route exception by properly logging the error and sending a err response to the
client.
|
void handle(Request req, Response rsp, Err ex) throws Throwable
Err
whenever you throw it or not. For example if your
application throws an IllegalArgumentException
exception you will get an Err
and you can retrieve the original exception by calling Throwable.getCause()
.
Jooby always give you an Err
with an optional root cause and an associated status
code.req
- HTTP request.rsp
- HTTP response.ex
- Error found and status code.Throwable
- If something goes wrong.Copyright © 2017. All rights reserved.