import { errorSignal } from '#editor/editor' import { EditorView } from '@codemirror/view' export const catchErrors = EditorView.exceptionSink.of((exception) => { console.error('CodeMirror error:', exception) errorSignal.emit( `Editor error: ${exception instanceof Error ? exception.message : String(exception)}` ) })