quarkus
quarkus copied to clipboard
Control the content of error attributes
Description
There is an interesting feature in Spring Boot which controls easily error attributes.
Default configuration:
server:
error:
include-stacktrace: never
include-message: never
include-binding-errors: never
include-exception: off
ErrorAttributeOptions
could be reused easily in custom application configuration properties
I saw exception-mapping
Implementation ideas
Implementation -> BasicErrorController
To see it in action:
-
generate a simple Spring Boot project with this link
-
create a GET endpoint
/boom
which throws an exception -
call
/boom
and see the response(properties includes/excludes) -
tweak server configuration:
server:
error:
include-stacktrace: always
include-message: always
- check returned response if it includes message + stacktrace
Thanks
It s a good idea in cases we have large amount of logs.
/cc @FroMage, @geoand, @stuartwdouglas
This indeed seems like an interesting feature. Do you know how widely used it is in Spring Boot?
Seems interesting. Related (a bit) to #13662.