Files
code-editor/outputframe-app/injects/try-catch.ts
T

12 lines
384 B
TypeScript

import { NotificationBubbles } from "../../codeeditor-app/elements/notification-bubbles/notification-bubbles";
export function tryCatch(fn: Function) {
try {
fn();
}
catch (err) {
var bubbles = <NotificationBubbles>parent.document.body.getElementsByTagName("notification-bubbles")[0];
//@ts-ignore
bubbles.add(err, 'syntax-error');
}
}