mirror of
https://github.com/bitwarden/browser
synced 2024-12-08 07:22:15 +01:00
Add try catch to handler
This commit is contained in:
parent
630eb14686
commit
c6ce0c1766
@ -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.",
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user