You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
301 B
JavaScript

"use strict";
module.exports = function getChain(error) {
let currentError = error;
let errors = [];
while (currentError != null) {
errors.push(currentError);
if (currentError._errorChainError === true) {
currentError = currentError.cause;
} else {
break;
}
}
return errors;
};