mirror of
https://github.com/n8n-io/n8n.git
synced 2025-02-21 02:56:40 -08:00
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:
parent
626879b3a2
commit
6127c958f5
|
@ -25,11 +25,17 @@ export const initErrorHandling = () => {
|
||||||
release,
|
release,
|
||||||
environment,
|
environment,
|
||||||
integrations: (integrations) => {
|
integrations: (integrations) => {
|
||||||
|
integrations = integrations.filter(({ name }) => name !== 'OnUncaughtException');
|
||||||
integrations.push(new RewriteFrames({ root: process.cwd() }));
|
integrations.push(new RewriteFrames({ root: process.cwd() }));
|
||||||
return integrations;
|
return integrations;
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
process.on('uncaughtException', (error) => {
|
||||||
|
ErrorReporterProxy.error(error);
|
||||||
|
if (error.constructor?.name !== 'AxiosError') throw error;
|
||||||
|
});
|
||||||
|
|
||||||
ErrorReporterProxy.init({
|
ErrorReporterProxy.init({
|
||||||
report: (error, options) => Sentry.captureException(error, options),
|
report: (error, options) => Sentry.captureException(error, options),
|
||||||
});
|
});
|
||||||
|
|
|
@ -187,15 +187,12 @@ export class Telemetry {
|
||||||
properties: updatedProperties,
|
properties: updatedProperties,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (withPostHog && this.postHog) {
|
if (withPostHog) {
|
||||||
return Promise.all([
|
this.postHog?.capture({
|
||||||
this.postHog.capture({
|
|
||||||
distinctId: payload.userId,
|
distinctId: payload.userId,
|
||||||
sendFeatureFlags: true,
|
sendFeatureFlags: true,
|
||||||
...payload,
|
...payload,
|
||||||
}),
|
});
|
||||||
this.rudderStack.track(payload),
|
|
||||||
]).then(() => resolve());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.rudderStack.track(payload, resolve);
|
return this.rudderStack.track(payload, resolve);
|
||||||
|
|
Loading…
Reference in a new issue