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
1 changed files with 15 additions and 7 deletions

View File

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