|
|
@ -2,7 +2,7 @@ module.exports = setupFetchDebugging |
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// This is a utility to help resolve cases where `window.fetch` throws a
|
|
|
|
// 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
|
|
|
|
// https://github.com/getsentry/sentry-javascript/pull/1293
|
|
|
|
//
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
@ -17,9 +17,11 @@ function setupFetchDebugging() { |
|
|
|
try { |
|
|
|
try { |
|
|
|
return await originalFetch.call(window, ...args) |
|
|
|
return await originalFetch.call(window, ...args) |
|
|
|
} catch (err) { |
|
|
|
} catch (err) { |
|
|
|
console.warn('FetchDebugger - fetch encountered an Error', err) |
|
|
|
if (!err.stack) { |
|
|
|
console.warn('FetchDebugger - overriding stack to point of original call') |
|
|
|
console.warn('FetchDebugger - fetch encountered an Error without a stack', err) |
|
|
|
err.stack = initialStack |
|
|
|
console.warn('FetchDebugger - overriding stack to point of original call') |
|
|
|
|
|
|
|
err.stack = initialStack
|
|
|
|
|
|
|
|
} |
|
|
|
throw err |
|
|
|
throw err |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|