From 6221a1a2671892df8a42a3c98057a8b5f1ea0597 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Thu, 20 Jul 2023 12:56:05 -0400 Subject: [PATCH] fix: add try/catch to DiscoveryIRC --- src/index.ts | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/index.ts b/src/index.ts index 416fbec..02f2980 100644 --- a/src/index.ts +++ b/src/index.ts @@ -41,12 +41,16 @@ async function handleDiscover(aq: ActiveQuery): Promise { return; } - const ret = await DiscoveryIRC(aq.callerInput.pubkey, { - host: "liberta.casa", - ...aq.callerInput?.options, - }); + try { + const ret = await DiscoveryIRC(aq.callerInput.pubkey, { + host: "liberta.casa", + ...aq.callerInput?.options, + }); - aq.respond(ret); + aq.respond(ret); + } catch (e) { + aq.reject(e); + } } addHandler("register", handleRegister);