Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Docs: Improved error docs in the ComponentFactory class.
Browse files Browse the repository at this point in the history
  • Loading branch information
oleq committed Mar 27, 2017
1 parent 4b0b394 commit 28ee3df
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/componentfactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ export default class ComponentFactory {
*/
add( name, callback ) {
if ( this._components.get( name ) ) {
/**
* The item already exists in the component factory.
*
* @error componentfactory-item-exists
* @param {String} name The name of the component.
*/
throw new CKEditorError(
'componentfactory-item-exists: The item already exists in the component factory.', { name }
);
Expand All @@ -71,8 +77,14 @@ export default class ComponentFactory {
const component = this._components.get( name );

if ( !component ) {
/**
* There is no such UI component in the factory.
*
* @error componentfactory-item-missing
* @param {String} name The name of the missing component.
*/
throw new CKEditorError(
'componentfactory-item-missing: There is no such component in the factory.', { name }
'componentfactory-item-missing: There is no such UI component in the factory.', { name }
);
}

Expand Down

0 comments on commit 28ee3df

Please sign in to comment.