10 lines
329 B
TypeScript
10 lines
329 B
TypeScript
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)}`
|
|
)
|
|
})
|