aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkumavis <aaron@kumavis.me>2018-10-19 18:42:53 +0800
committerkumavis <aaron@kumavis.me>2018-10-19 18:42:53 +0800
commitb85ae55cd59b4f8fe52ec75e1b7c6efe52a02e3f (patch)
treea9f9ff75f7a79c0edb7eb9fd5ce70e54c1086657
parent3e3d4b9ddef032fe81419a516e65eb62ed664cb9 (diff)
downloadtangerine-wallet-browser-b85ae55cd59b4f8fe52ec75e1b7c6efe52a02e3f.tar
tangerine-wallet-browser-b85ae55cd59b4f8fe52ec75e1b7c6efe52a02e3f.tar.gz
tangerine-wallet-browser-b85ae55cd59b4f8fe52ec75e1b7c6efe52a02e3f.tar.bz2
tangerine-wallet-browser-b85ae55cd59b4f8fe52ec75e1b7c6efe52a02e3f.tar.lz
tangerine-wallet-browser-b85ae55cd59b4f8fe52ec75e1b7c6efe52a02e3f.tar.xz
tangerine-wallet-browser-b85ae55cd59b4f8fe52ec75e1b7c6efe52a02e3f.tar.zst
tangerine-wallet-browser-b85ae55cd59b4f8fe52ec75e1b7c6efe52a02e3f.zip
fetch debugger - only append source stack if no stack is present
-rw-r--r--app/scripts/lib/setupFetchDebugging.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/app/scripts/lib/setupFetchDebugging.js b/app/scripts/lib/setupFetchDebugging.js
index dd87b65a6..c1ef22d21 100644
--- a/app/scripts/lib/setupFetchDebugging.js
+++ b/app/scripts/lib/setupFetchDebugging.js
@@ -2,7 +2,7 @@ module.exports = setupFetchDebugging
//
// This is a utility to help resolve cases where `window.fetch` throws a
-// `TypeError: Failed to Fetch` without any stack or context for the request
+// `TypeError: Failed to Fetch` without any stack or context for the request
// https://github.com/getsentry/sentry-javascript/pull/1293
//
@@ -17,9 +17,11 @@ function setupFetchDebugging() {
try {
return await originalFetch.call(window, ...args)
} catch (err) {
- console.warn('FetchDebugger - fetch encountered an Error', err)
- console.warn('FetchDebugger - overriding stack to point of original call')
- err.stack = initialStack
+ if (!err.stack) {
+ console.warn('FetchDebugger - fetch encountered an Error without a stack', err)
+ console.warn('FetchDebugger - overriding stack to point of original call')
+ err.stack = initialStack
+ }
throw err
}
}