# utils/ckeditorerror

module

<a id="constants">

## Constants

<a id="constant-DOCUMENTATION_URL">

### `DOCUMENTATION_URL: 'https://ckeditor.com/docs/ckeditor5/latest/support/error-codes.html'`

URL to the documentation with error codes.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-utils/src/ckeditorerror.ts#L13)

<a id="classes">

## Classes

<a id="class-CKEditorError">

### [CKEditorError](module_utils_ckeditorerror-CKEditorError.md)

<a id="functions">

## Functions

<a id="function-logError">

### `logError( errorName, data? ) → void`

Logs an error to the console with a properly formatted message and adds a link to the documentation. Use whenever you want to log an error to the console.

```typescript
/**
 * There was a problem processing the configuration of the toolbar. The item with the given
 * name does not exist, so it was omitted when rendering the toolbar.
 *
 * @error toolbarview-item-unavailable
 * @param {String} name The name of the component.
 */
 logError( 'toolbarview-item-unavailable', { name } );
```

**Note**: In most cases logging a warning using [`logWarning`](#function-logWarning) is enough.

See also [`CKEditorError`](module_utils_ckeditorerror-CKEditorError.md) for an explanation when to use each method.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-utils/src/ckeditorerror.ts#L165)

#### Parameters

* `errorName: string`

  The error name to be logged.

* `data?: object`

  Additional data to be logged.

#### Returns

* `void`

<a id="function-logWarning">

### `logWarning( errorName, data? ) → void`

Logs a warning to the console with a properly formatted message and adds a link to the documentation. Use whenever you want to log a warning to the console.

```typescript
/**
 * There was a problem processing the configuration of the toolbar. The item with the given
 * name does not exist, so it was omitted when rendering the toolbar.
 *
 * @error toolbarview-item-unavailable
 * @param {String} name The name of the component.
 */
logWarning( 'toolbarview-item-unavailable', { name } );
```

See also [`CKEditorError`](module_utils_ckeditorerror-CKEditorError.md) for an explanation when to throw an error and when to log a warning or an error to the console.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-utils/src/ckeditorerror.ts#L139)

#### Parameters

* `errorName: string`

  The error name to be logged.

* `data?: object`

  Additional data to be logged.

#### Returns

* `void`

---

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