Skip to content

Commit

Permalink
Update lib/resolvers/error.js
Browse files Browse the repository at this point in the history
Co-authored-by: Marcel Schwarz <[email protected]>
  • Loading branch information
arleytm and schwma authored Nov 13, 2023
1 parent a28f824 commit 68238cb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/resolvers/error.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,12 @@ const _log = error => {
// HTTP response to HTTP Clients to be displayed in the user interface.
let error2log = _clone(error)
if (error.details) error2log.details = error.details.map(error => _clone(error))
error2log = normalizeError(error2log, { locale: i18n.default_language }, error => error).error
const formatterFn = error => {
// No stack for outer error of multiple errors, since the stacktrace is not meaningful
if (error.details) delete error.stack
return error
}
error2log = normalizeError(error2log, { locale: i18n.default_language }, formatterFn).error

// determine if the status code represents a client error (4xx range)
if (isClientError(error2log)) {
Expand Down

0 comments on commit 68238cb

Please sign in to comment.