overleaf/services/web/frontend/js/features/source-editor/extensions/exception-logger.ts

12 lines
359 B
TypeScript
Raw Normal View History

import { Extension } from '@codemirror/state'
import { EditorView } from '@codemirror/view'
import { captureException } from '../../../infrastructure/error-reporter'
export const exceptionLogger = (): Extension => {
return EditorView.exceptionSink.of(exception => {
captureException(exception, {
tags: { handler: 'cm6-exception' },
})
})
}