1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-10 21:33:27 +00:00

Handle error object for biometric lock (#9070)

This commit is contained in:
Matt Gibson
2024-05-07 17:43:42 -04:00
committed by GitHub
parent 7bb37877ee
commit ea7d1ff6ed

View File

@@ -143,15 +143,17 @@ export class LockComponent extends BaseLockComponent {
try { try {
success = await super.unlockBiometric(); success = await super.unlockBiometric();
} catch (e) { } catch (e) {
const error = BiometricErrors[e as BiometricErrorTypes]; const error = BiometricErrors[e?.message as BiometricErrorTypes];
if (error == null) { if (error == null) {
this.logService.error("Unknown error: " + e); this.logService.error("Unknown error: " + e);
return false;
} }
this.biometricError = this.i18nService.t(error.description); this.biometricError = this.i18nService.t(error.description);
} } finally {
this.pendingBiometric = false; this.pendingBiometric = false;
}
return success; return success;
} }