Skip to content

Commit 4cbb347

Browse files
committed
chore(shape): wrap callback with try-catch
1 parent 1b7dd07 commit 4cbb347

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/classes/shape.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,11 @@ export class Shape {
172172
): void {
173173
callbacks.forEach((callback) => {
174174
if (typeof callback === 'function') {
175-
callback(element, arg1, arg2);
175+
try {
176+
callback(element, arg1, arg2);
177+
} catch (e) {
178+
console.log(e);
179+
}
176180
}
177181
});
178182
}

0 commit comments

Comments
 (0)