From b8aae90d1b129c810d240688be1d00e15ee99f99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cchrisshank=E2=80=9D?= Date: Sun, 24 Nov 2024 15:57:14 -0800 Subject: [PATCH] add runtime error handling to rope --- src/arrows/event-propagator.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/arrows/event-propagator.ts b/src/arrows/event-propagator.ts index 8ab89bc..6cc5d8c 100644 --- a/src/arrows/event-propagator.ts +++ b/src/arrows/event-propagator.ts @@ -101,7 +101,11 @@ export class EventPropagator extends FolkRope { // Do we need the event at all? evaluateExpression = (event?: Event) => { if (this.sourceElement === null || this.targetElement === null) return; - - this.#function(this.sourceElement, this.targetElement, event); + this.stroke = 'black'; + try { + this.#function(this.sourceElement, this.targetElement, event); + } catch (error) { + this.stroke = 'red'; + } }; }