Description
In Version 3.3.1 60b7e6c got merged.
Implementing custom logic for an error response is done by extending DefaultErrorAttributes
, overriding getErrorAttributes()
and changing the map returned by super.getErrorAttributes(request, options)
.
I think it does not behave correctly anymore since this change, because now getErrorAttributes()
is called twice - on the first call the options
only include STATUS
and on the second call the options are ErrorAttributeOptions.defaults()
(or whatever is configured), see: 60b7e6c#diff-b4233363b899b2fb4ab8045726ed3e9d6d04c766cb363c2973c137750b340b62R150-R151
When using custom logic this may lead to a NPE when the map unexpectedly only contains "status"
on the first call.
It still works correctly for the non-reactive version where getErrorAttributes()
is only called once when overriden.
We could handle the first call ourselves by discarding it when the options only include STATUS
but I don't think that's the desired solution.