From e5bf3b1aed609405f6a1ef899c50fc739d5074a2 Mon Sep 17 00:00:00 2001 From: maze Date: Sat, 14 Mar 2026 22:15:12 +0100 Subject: [PATCH] Throw more descriptive errors --- src/identity.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/identity.ts b/src/identity.ts index 55234a1..112a12d 100644 --- a/src/identity.ts +++ b/src/identity.ts @@ -320,7 +320,7 @@ export class Contacts { const hash = parseNodeHash(channelHash) as number; const groups = this.groups[hash] || []; if (groups.length === 0) { - throw new Error("Unknown group hash"); + throw new Error(`Unknown group hash ${hash.toString(16).padStart(2, "0")}`); } for (const group of groups) { try { @@ -330,7 +330,7 @@ export class Contacts { // Ignore decryption errors and try the next group. } } - throw new Error("Decryption failed with all known groups"); + throw new Error(`Decryption failed with all known groups with hash ${hash.toString(16).padStart(2, "0")}`); } public decryptGroupData( @@ -344,7 +344,7 @@ export class Contacts { const hash = parseNodeHash(channelHash) as number; const groups = this.groups[hash] || []; if (groups.length === 0) { - throw new Error("Unknown group hash"); + throw new Error(`Unknown group hash ${hash.toString(16).padStart(2, "0")}`); } for (const group of groups) { try { @@ -354,6 +354,6 @@ export class Contacts { // Ignore decryption errors and try the next group. } } - throw new Error("Decryption failed with all known groups"); + throw new Error(`Decryption failed with all known groups with hash ${hash.toString(16).padStart(2, "0")}`); } }