From 284c271e7f6041ef542facf3ea5e2aa946c72bcf Mon Sep 17 00:00:00 2001 From: Bernd Schoolmann Date: Wed, 17 Dec 2025 11:16:29 +0100 Subject: [PATCH] Fix types --- libs/common/src/platform/models/domain/domain-base.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/libs/common/src/platform/models/domain/domain-base.ts b/libs/common/src/platform/models/domain/domain-base.ts index f10105976d1..089c5e799ed 100644 --- a/libs/common/src/platform/models/domain/domain-base.ts +++ b/libs/common/src/platform/models/domain/domain-base.ts @@ -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; }