File tree 3 files changed +9
-22
lines changed
http2/src/main/java/io/helidon/webserver/http2
webserver/src/main/java/io/helidon/webserver
3 files changed +9
-22
lines changed Original file line number Diff line number Diff line change @@ -312,23 +312,16 @@ public void run() {
312
312
// gather error handling properties
313
313
ErrorHandling errorHandling = ctx .listenerContext ()
314
314
.config ()
315
- .errorHandling ()
316
- .orElse (null );
317
- boolean includeEntity = false ;
318
- boolean logAllMessages = false ;
319
- if (errorHandling != null ) {
320
- includeEntity = errorHandling .includeEntity ();
321
- logAllMessages = errorHandling .logAllMessages ();
322
- }
315
+ .errorHandling ();
323
316
324
317
// log message in DEBUG mode
325
- if (LOGGER .isLoggable (DEBUG ) && (e .safeMessage () || logAllMessages )) {
318
+ if (LOGGER .isLoggable (DEBUG ) && (e .safeMessage () || errorHandling . logAllMessages () )) {
326
319
LOGGER .log (DEBUG , e );
327
320
}
328
321
329
322
// create message to return based on settings
330
323
String message = null ;
331
- if (includeEntity ) {
324
+ if (errorHandling . includeEntity () ) {
332
325
message = e .safeMessage () ? e .getMessage () : "Bad request, see server log for more information" ;
333
326
}
334
327
Original file line number Diff line number Diff line change @@ -403,8 +403,9 @@ default void configureSocket(ServerSocket socket) {
403
403
/**
404
404
* Configuration for this listener's error handling.
405
405
*
406
- * @return optional error handling
406
+ * @return error handling
407
407
*/
408
408
@ Option .Configured
409
- Optional <ErrorHandling > errorHandling ();
409
+ @ Option .DefaultMethod ("create" )
410
+ ErrorHandling errorHandling ();
410
411
}
Original file line number Diff line number Diff line change @@ -648,23 +648,16 @@ private void handleRequestException(RequestException e) {
648
648
// gather error handling properties
649
649
ErrorHandling errorHandling = ctx .listenerContext ()
650
650
.config ()
651
- .errorHandling ()
652
- .orElse (null );
653
- boolean includeEntity = false ;
654
- boolean logAllMessages = false ;
655
- if (errorHandling != null ) {
656
- includeEntity = errorHandling .includeEntity ();
657
- logAllMessages = errorHandling .logAllMessages ();
658
- }
651
+ .errorHandling ();
659
652
660
653
// log message in DEBUG mode
661
- if (LOGGER .isLoggable (DEBUG ) && (e .safeMessage () || logAllMessages )) {
654
+ if (LOGGER .isLoggable (DEBUG ) && (e .safeMessage () || errorHandling . logAllMessages () )) {
662
655
LOGGER .log (DEBUG , e );
663
656
}
664
657
665
658
// create message to return based on settings
666
659
String message = null ;
667
- if (includeEntity ) {
660
+ if (errorHandling . includeEntity () ) {
668
661
message = e .safeMessage () ? e .getMessage () : "Bad request, see server log for more information" ;
669
662
}
670
663
You can’t perform that action at this time.
0 commit comments