12 lines
384 B
TypeScript
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');
|
|
}
|
|
} |