1
0
mirror of https://github.com/bitwarden/browser synced 2024-12-08 15:25:54 +01:00

Add try catch to handler

This commit is contained in:
Thomas Avery 2024-11-01 16:07:18 -05:00
parent 630eb14686
commit c6ce0c1766
No known key found for this signature in database
GPG Key ID: 44A02A0410B0F429

View File

@ -30,15 +30,23 @@ export class DefaultUserAsymmetricKeysRegenerationService
) {} ) {}
async handleUserAsymmetricKeysRegeneration(userId: UserId): Promise<void> { async handleUserAsymmetricKeysRegeneration(userId: UserId): Promise<void> {
const privateKeyRegenerationFlag = await this.configService.getFeatureFlag( try {
FeatureFlag.PrivateKeyRegeneration, const privateKeyRegenerationFlag = await this.configService.getFeatureFlag(
); FeatureFlag.PrivateKeyRegeneration,
);
if (privateKeyRegenerationFlag) { if (privateKeyRegenerationFlag) {
const shouldRegenerate = await this.shouldRegenerate(userId); const shouldRegenerate = await this.shouldRegenerate(userId);
if (shouldRegenerate) { if (shouldRegenerate) {
await this.regenerateUserAsymmetricKeys(userId); await this.regenerateUserAsymmetricKeys(userId);
}
} }
} catch (error) {
this.logService.error(
"[UserAsymmetricKeyRegeneration] User Key regeneration error: " +
error +
" Skipping regeneration for the user.",
);
} }
} }