1
0
mirror of https://github.com/bitwarden/browser synced 2026-01-30 16:23:53 +00:00

Fix types

This commit is contained in:
Bernd Schoolmann
2025-12-17 11:16:29 +01:00
parent fd75b8a8ba
commit 284c271e7f

View File

@@ -87,11 +87,18 @@ export default class Domain {
try {
viewModel[prop] = await encryptService.decryptString(domain[prop]!, key);
} catch (e) {
// In case the SDK maps to a non-Error type, this is defensive
const errorMsg =
typeof e === "object" && e !== null && "message" in e
? (e as { message: string }).message
: String(e);
// eslint-disable-next-line no-console
console.error(
`Failed to decrypt property '${String(
prop,
)}' of domain. Context: ${objectContext}. Error: ${"message" in e ? e.message : String(e)}`, // In case the SDK maps to a non-Error type, this is defensive
)}' of domain. Context: ${objectContext}. Error: ${errorMsg}`,
);
viewModel[prop] = DECRYPT_ERROR;
}