Skip to content

Commit 7fe1070

Browse files
committed
err handler does not use CORS settings fix #928
1 parent fab7b91 commit 7fe1070

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

doc/err.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
An error handler in Jooby is represented by the [Err.Handler]({{defdocs}}/Err.Handler.html) class and allows you to log and render exceptions.
44

5+
> NOTE: All headers are reset while generating the error response.
6+
57
## default err handler
68

79
The [default error handler]({{defdocs}}/Err.DefHandler.html) does content negotiation and optionally displays friendly error pages using a naming convention.

jooby/src/main/java/org/jooby/Router.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3585,6 +3585,8 @@ default <T> WebSocket.Definition ws(final Class<? extends WebSocket.OnMessage<T>
35853585
* Setup a custom error handler.The error handler will be executed if the current exception is an
35863586
* instance of given type type.
35873587
*
3588+
* All headers are reset while generating the error response.
3589+
*
35883590
* @param type Exception type. The error handler will be executed if the current exception is an
35893591
* instance of this type.
35903592
* @param handler A route error handler.
@@ -3603,6 +3605,8 @@ default Router err(final Class<? extends Throwable> type, final Err.Handler hand
36033605
* Setup a route error handler. The error handler will be executed if current status code matches
36043606
* the one provided.
36053607
*
3608+
* All headers are reset while generating the error response.
3609+
*
36063610
* @param statusCode The status code to match.
36073611
* @param handler A route error handler.
36083612
* @return This router.
@@ -3620,6 +3624,8 @@ default Router err(final int statusCode, final Err.Handler handler) {
36203624
* Setup a route error handler. The error handler will be executed if current status code matches
36213625
* the one provided.
36223626
*
3627+
* All headers are reset while generating the error response.
3628+
*
36233629
* @param code The status code to match.
36243630
* @param handler A route error handler.
36253631
* @return This router.
@@ -3637,6 +3643,8 @@ default Router err(final Status code, final Err.Handler handler) {
36373643
* Setup a route error handler. The error handler will be executed if current status code matches
36383644
* the one provided.
36393645
*
3646+
* All headers are reset while generating the error response.
3647+
*
36403648
* @param predicate Apply the error handler if the predicate evaluates to <code>true</code>.
36413649
* @param handler A route error handler.
36423650
* @return This router.

0 commit comments

Comments
 (0)