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

@@ -187,15 +187,12 @@ export class Telemetry {
properties: updatedProperties,
};
if (withPostHog && this.postHog) {
return Promise.all([
this.postHog.capture({
distinctId: payload.userId,
sendFeatureFlags: true,
...payload,
}),
this.rudderStack.track(payload),
]).then(() => resolve());
if (withPostHog) {
this.postHog?.capture({
distinctId: payload.userId,
sendFeatureFlags: true,
...payload,
});
}
return this.rudderStack.track(payload, resolve);