public static class Err.DefHandler extends Object implements Err.Handler
text/html requests the err handler creates an err view and use the Err.toMap() result as model.
| Constructor and Description |
|---|
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.
|
public static final String VIEW
public void handle(Request req, Response rsp, Err ex) throws Throwable
Err.Handler
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.
handle in interface Err.Handler
req - HTTP request.
rsp - HTTP response.
ex - Error found and status code.
Throwable - If something goes wrong.
Copyright © 2019. All rights reserved.