Throw more descriptive errors
This commit is contained in:
@@ -320,7 +320,7 @@ export class Contacts {
|
|||||||
const hash = parseNodeHash(channelHash) as number;
|
const hash = parseNodeHash(channelHash) as number;
|
||||||
const groups = this.groups[hash] || [];
|
const groups = this.groups[hash] || [];
|
||||||
if (groups.length === 0) {
|
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) {
|
for (const group of groups) {
|
||||||
try {
|
try {
|
||||||
@@ -330,7 +330,7 @@ export class Contacts {
|
|||||||
// Ignore decryption errors and try the next group.
|
// 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(
|
public decryptGroupData(
|
||||||
@@ -344,7 +344,7 @@ export class Contacts {
|
|||||||
const hash = parseNodeHash(channelHash) as number;
|
const hash = parseNodeHash(channelHash) as number;
|
||||||
const groups = this.groups[hash] || [];
|
const groups = this.groups[hash] || [];
|
||||||
if (groups.length === 0) {
|
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) {
|
for (const group of groups) {
|
||||||
try {
|
try {
|
||||||
@@ -354,6 +354,6 @@ export class Contacts {
|
|||||||
// Ignore decryption errors and try the next group.
|
// 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")}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user