fix: Do not crash the server when Telemetry is blocked via DNS (#4947)

* do not crash the process on unhandled axios errors

* postHog.capture does not return a promise
This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2022-12-16 13:23:24 +01:00
committed by GitHub
parent 626879b3a2
commit 6127c958f5
2 changed files with 12 additions and 9 deletions

View File

@@ -25,11 +25,17 @@ export const initErrorHandling = () => {
release,
environment,
integrations: (integrations) => {
integrations = integrations.filter(({ name }) => name !== 'OnUncaughtException');
integrations.push(new RewriteFrames({ root: process.cwd() }));
return integrations;
},
});
process.on('uncaughtException', (error) => {
ErrorReporterProxy.error(error);
if (error.constructor?.name !== 'AxiosError') throw error;
});
ErrorReporterProxy.init({
report: (error, options) => Sentry.captureException(error, options),
});