summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/internal/error-serdes.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/internal/error-serdes.js b/lib/internal/error-serdes.js
index 6b88f100c8..7b4b416b80 100644
--- a/lib/internal/error-serdes.js
+++ b/lib/internal/error-serdes.js
@@ -86,7 +86,7 @@ function serializeError(error) {
if (typeof error === 'object' &&
ObjectPrototypeToString(error) === '[object Error]') {
const constructors = GetConstructors(error);
- for (var i = constructors.length - 1; i >= 0; i--) {
+ for (var i = 0; i < constructors.length; i++) {
const name = GetName(constructors[i]);
if (errorConstructorNames.has(name)) {
try { error.stack; } catch {}