Skip to content

Commit

Permalink
Add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed Jun 5, 2022
1 parent 6be57a4 commit d9619a5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/error/merge.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ export const mergeErrorCause = function (error) {
return mergeCause(errorA)
}

// The recursion is applied pair by pair, as opposed to all errors at once.
// - This ensures the same result no matter how many times this function
// applied along the stack trace
const mergeCause = function (error) {
if (error.cause === undefined) {
return error
Expand Down

0 comments on commit d9619a5

Please sign in to comment.