You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The stack format change slightly and we were no longer matching on the correct stuff to clean up: "(internal/..." became "(node:internal/..."
Took the occasion to swap them out with regex and inline the one-off cleanup logic too (IIRC I kept it separate because not all repos wanted that cleanup. But nobody cares now)
// clean up stack trace! Stack format: https://nodejs.org/api/errors.html#errors_error_stack
45
+
obj["stack"]
46
+
->String.replaceRegExp(%re("/\n /g"), "\n ") // indent 2 spaces instead of 4, to align with code frame
47
+
->String.replaceRegExp(%re("/^Error\n/"), "") // first line is just the word "Error"
48
+
->String.replaceRegExp(%re("/^.+\n/"), "") // second line (now first) is this Test module's own stack frame
49
+
->String.replaceRegExp(%re("/\n at .+\(node:internal.+\n?/g"), "") // remove internal lines like " at ModuleJob.run (node:internal/modules/esm/module_job:193:25)"
0 commit comments