Fix updating payload on request.error filter (#18137)

Fixes #17002
This commit is contained in:
Rijk van Zanten
2023-04-11 16:14:44 -04:00
committed by GitHub
parent 1a843061ee
commit b7f352eec2

View File

@@ -99,8 +99,8 @@ const errorHandler: ErrorRequestHandler = (err, req, res, _next) => {
accountability: req.accountability ?? null,
}
)
.then(() => {
return res.json(payload);
.then((updatedErrors) => {
return res.json({ ...payload, errors: updatedErrors });
});
};