From e025296d2c89045c1edf88b9d1f5d9eb3c2279d5 Mon Sep 17 00:00:00 2001 From: Laurent Cozic Date: Sat, 9 Nov 2024 20:03:21 +0000 Subject: [PATCH] error handling --- packages/lib/eventManager.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/lib/eventManager.ts b/packages/lib/eventManager.ts index de762e88222..21fd67bba29 100644 --- a/packages/lib/eventManager.ts +++ b/packages/lib/eventManager.ts @@ -137,7 +137,13 @@ export class EventManager { // deep equality check to see if it's been changed. Normally the // filter objects should be relatively small so there shouldn't be // much of a performance hit. - const newOutput = await listener(output); + let newOutput = null; + try { + newOutput = await listener(output); + } catch (error) { + error.message = `Error in listener when calling: ${filterName}: ${error.message}`; + throw error; + } // Plugin didn't return anything - so we leave the object as it is. if (newOutput === undefined) continue;