*Wrap err in Error

This commit is contained in:
Derrick Hammer 2022-07-20 03:26:55 -04:00
parent 1fabdc7e4d
commit 2437037a14
1 changed files with 2 additions and 2 deletions

View File

@ -27,7 +27,7 @@ export class DHT {
public async connect(pubkey: string): Promise<Socket> {
const [resp, err] = await callModule(DHT_MODULE, "connect", { pubkey });
if (err) {
throw err;
throw new Error(err);
}
return new Socket(resp.id);
}
@ -39,7 +39,7 @@ export class DHT {
public async addRelay(pubkey: string): Promise<void> {
const [, err] = await callModule(DHT_MODULE, "addRelay", { pubkey });
if (err) {
throw err;
throw new Error(err);
}
}
}