improve captured message of Error object (#835)
try to fix this problem: https://github.com/rrweb-io/rrweb/issues/814#issuecomment-1033735775
This commit is contained in:
@@ -137,7 +137,9 @@ export function stringify(
|
|||||||
}
|
}
|
||||||
return value.nodeName;
|
return value.nodeName;
|
||||||
} else if (value instanceof Error) {
|
} else if (value instanceof Error) {
|
||||||
return value.name + ': ' + value.message;
|
return value.stack
|
||||||
|
? value.stack + '\nEnd of stack for Error object'
|
||||||
|
: value.name + ': ' + value.message;
|
||||||
}
|
}
|
||||||
return value;
|
return value;
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -7816,7 +7816,7 @@ exports[`record integration tests should record console messages 1`] = `
|
|||||||
\\"__puppeteer_evaluation_script__:19:37\\"
|
\\"__puppeteer_evaluation_script__:19:37\\"
|
||||||
],
|
],
|
||||||
\\"payload\\": [
|
\\"payload\\": [
|
||||||
\\"\\\\\\"TypeError: a message\\\\\\"\\"
|
\\"\\\\\\"TypeError: a message\\\\\\\\n at __puppeteer_evaluation_script__:19:41\\\\\\\\nEnd of stack for Error object\\\\\\"\\"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user