From c3dfb1d5607627e45595347628f39eb7546009da Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sun, 23 Jan 2022 01:31:37 -0400 Subject: track data --- src/util/sugar.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/util/sugar.js') diff --git a/src/util/sugar.js b/src/util/sugar.js index 64291f36..075aa190 100644 --- a/src/util/sugar.js +++ b/src/util/sugar.js @@ -328,7 +328,7 @@ export function withAggregate(aggregateOpts, fn) { return result; } -export function showAggregate(topError) { +export function showAggregate(topError, {pathToFile = null} = {}) { const recursive = error => { const stackLines = error.stack?.split('\n'); const stackLine = stackLines?.find(line => @@ -336,7 +336,7 @@ export function showAggregate(topError) { && !line.includes('sugar') && !line.includes('node:internal')); const tracePart = (stackLine - ? '- ' + stackLine.trim() + ? '- ' + stackLine.trim().replace(/file:\/\/(.*\.js)/, (match, pathname) => pathToFile(pathname)) : '(no stack trace)'); const header = `[${error.constructor.name || 'unnamed'}] ${error.message || '(no message)'} ${color.dim(tracePart)}`; -- cgit 1.3.0-6-gf8a5