improv: add error handling

This commit is contained in:
tomasz-io 2024-11-28 18:16:39 -08:00
parent 2e3fdb34e2
commit c031bdfced

View file

@ -102,11 +102,15 @@ export class Telemetry {
}
static async getValueForFeatureFlag(flag: PosthogFeatureFlag) {
const userGroup = await Telemetry.getFeatureFlag(flag);
if (typeof userGroup === "string") {
return EXPERIMENTS[flag][userGroup].value;
}
try {
const userGroup = await Telemetry.getFeatureFlag(flag);
if (typeof userGroup === "string") {
return EXPERIMENTS[flag][userGroup].value;
}
return undefined;
return undefined;
} catch {
return undefined;
}
}
}