aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/lib/setupFetchDebugging.js
diff options
context:
space:
mode:
authorkumavis <kumavis@users.noreply.github.com>2018-10-30 09:57:51 +0800
committerGitHub <noreply@github.com>2018-10-30 09:57:51 +0800
commit73eeeda2157e8a7ef61ff1f1fd0f4b94821f2e6f (patch)
tree51b163f772d253b8e56588fd254ca918a8b058a2 /app/scripts/lib/setupFetchDebugging.js
parent310229d22e5e916e8d6e3b1a469b9b196e0f70c2 (diff)
parent7ae5a23b6c0e9839f63bba52ab5bf7da00bef173 (diff)
downloadtangerine-wallet-browser-73eeeda2157e8a7ef61ff1f1fd0f4b94821f2e6f.tar
tangerine-wallet-browser-73eeeda2157e8a7ef61ff1f1fd0f4b94821f2e6f.tar.gz
tangerine-wallet-browser-73eeeda2157e8a7ef61ff1f1fd0f4b94821f2e6f.tar.bz2
tangerine-wallet-browser-73eeeda2157e8a7ef61ff1f1fd0f4b94821f2e6f.tar.lz
tangerine-wallet-browser-73eeeda2157e8a7ef61ff1f1fd0f4b94821f2e6f.tar.xz
tangerine-wallet-browser-73eeeda2157e8a7ef61ff1f1fd0f4b94821f2e6f.tar.zst
tangerine-wallet-browser-73eeeda2157e8a7ef61ff1f1fd0f4b94821f2e6f.zip
Merge pull request #5560 from MetaMask/sentry-enhancements2
Sentry - various enhancements to help debugging (alternate)
Diffstat (limited to 'app/scripts/lib/setupFetchDebugging.js')
-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
}
}