# core/errorreporter

module

<a id="interfaces">

## Interfaces

<a id="interface-EditorErrorData">

### `EditorErrorData`

<a id="type-definitions">

## Type Definitions

<a id="typedef-EditorErrorCallback">

### `EditorErrorCallback`

<a id="functions">

## Functions

<a id="function-onEditorError">

### `onEditorError( callback ) → () => void`

Registers a callback for errors that escape an editor, and returns a function that unregisters it.

```typescript
const off = onEditorError( ( { error, source } ) => {
	if ( source !== myEditor ) {
		return;
	}

	reportToMyErrorTracker( error );
} );
```

There is one registration surface for the whole page rather than one per editor, so an integrator running several editors compares `source` with their own instance, as above. Registering the same callback twice gives two independent registrations, and each unregisters on its own.

One error can reach the callback more than once, once for every editor it is attributed to — see [`source`](module_core_errorreporter-EditorErrorData.md#member-source).

Reporting only. Nothing is restarted and nothing is swallowed — the error still reaches the console.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-core/src/errorreporter.ts#L190)

#### Parameters

* `callback: EditorErrorCallback`

#### Returns

* `() => void`

---

Full index of the CKEditor 5 API reference: [llms.txt](llms.txt)
