add runtime error handling to rope
This commit is contained in:
parent
07ef31d6b2
commit
b8aae90d1b
|
|
@ -101,7 +101,11 @@ export class EventPropagator extends FolkRope {
|
||||||
// Do we need the event at all?
|
// Do we need the event at all?
|
||||||
evaluateExpression = (event?: Event) => {
|
evaluateExpression = (event?: Event) => {
|
||||||
if (this.sourceElement === null || this.targetElement === null) return;
|
if (this.sourceElement === null || this.targetElement === null) return;
|
||||||
|
this.stroke = 'black';
|
||||||
|
try {
|
||||||
this.#function(this.sourceElement, this.targetElement, event);
|
this.#function(this.sourceElement, this.targetElement, event);
|
||||||
|
} catch (error) {
|
||||||
|
this.stroke = 'red';
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue