Add the key definition name in the error for buildKey (#8355)

This commit is contained in:
Justin Baur 2024-03-15 15:15:53 -05:00 committed by GitHub
parent b99153a016
commit 4fabc94c3c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 1 deletions

View File

@ -138,7 +138,9 @@ export class UserKeyDefinition<T> {
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;
}