improv: add error handling
This commit is contained in:
parent
2e3fdb34e2
commit
c031bdfced
1 changed files with 9 additions and 5 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue