try-catch.ts
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');
}
}