From 4fabc94c3c761993695de7095b1a3455277e0b43 Mon Sep 17 00:00:00 2001 From: Justin Baur <19896123+justindbaur@users.noreply.github.com> Date: Fri, 15 Mar 2024 15:15:53 -0500 Subject: [PATCH] Add the key definition name in the error for buildKey (#8355) --- libs/common/src/platform/state/user-key-definition.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libs/common/src/platform/state/user-key-definition.ts b/libs/common/src/platform/state/user-key-definition.ts index 99e3039e1e..3405b38837 100644 --- a/libs/common/src/platform/state/user-key-definition.ts +++ b/libs/common/src/platform/state/user-key-definition.ts @@ -138,7 +138,9 @@ export class UserKeyDefinition { buildKey(userId: UserId) { if (!Utils.isGuid(userId)) { - throw new Error("You cannot build a user key without a valid UserId"); + throw new Error( + `You cannot build a user key without a valid UserId, building for key ${this.fullName}`, + ); } return `user_${userId}_${this.stateDefinition.name}_${this.key}` as StorageKey; }