瀏覽代碼

Docs: Improved error docs in the ComponentFactory class.

Aleksander Nowodzinski 8 年之前
父節點
當前提交
e4f5762a1b
共有 1 個文件被更改,包括 13 次插入1 次删除
  1. 13 1
      packages/ckeditor5-ui/src/componentfactory.js

+ 13 - 1
packages/ckeditor5-ui/src/componentfactory.js

@@ -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 }
 			);
@@ -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 }
 			);
 		}