Kaynağa Gözat

Merge pull request #547 from ckeditor/t/527

T/527 Fixes inconsistent error names
Szymon Cofalik 9 yıl önce
ebeveyn
işleme
e45c2b3865
30 değiştirilmiş dosya ile 80 ekleme ve 80 silme
  1. 1 1
      packages/ckeditor5-engine/src/model/batch.js
  2. 3 3
      packages/ckeditor5-engine/src/model/document.js
  3. 1 1
      packages/ckeditor5-engine/src/model/history.js
  4. 1 1
      packages/ckeditor5-engine/src/model/liveposition.js
  5. 2 2
      packages/ckeditor5-engine/src/model/node.js
  6. 5 5
      packages/ckeditor5-engine/src/model/nodelist.js
  7. 1 1
      packages/ckeditor5-engine/src/model/operation/attributeoperation.js
  8. 6 6
      packages/ckeditor5-engine/src/model/position.js
  9. 3 3
      packages/ckeditor5-engine/src/model/schema.js
  10. 3 3
      packages/ckeditor5-engine/src/model/selection.js
  11. 2 2
      packages/ckeditor5-engine/src/model/treewalker.js
  12. 2 2
      packages/ckeditor5-engine/src/view/position.js
  13. 2 2
      packages/ckeditor5-engine/src/view/renderer.js
  14. 5 5
      packages/ckeditor5-engine/src/view/selection.js
  15. 2 2
      packages/ckeditor5-engine/src/view/treewalker.js
  16. 1 1
      packages/ckeditor5-engine/tests/model/batch.js
  17. 3 3
      packages/ckeditor5-engine/tests/model/document/document.js
  18. 1 1
      packages/ckeditor5-engine/tests/model/history.js
  19. 1 1
      packages/ckeditor5-engine/tests/model/liveposition.js
  20. 2 2
      packages/ckeditor5-engine/tests/model/node.js
  21. 2 2
      packages/ckeditor5-engine/tests/model/nodelist.js
  22. 1 1
      packages/ckeditor5-engine/tests/model/operation/attributeoperation.js
  23. 8 8
      packages/ckeditor5-engine/tests/model/position.js
  24. 3 3
      packages/ckeditor5-engine/tests/model/schema/schema.js
  25. 4 4
      packages/ckeditor5-engine/tests/model/selection.js
  26. 4 4
      packages/ckeditor5-engine/tests/model/treewalker.js
  27. 2 2
      packages/ckeditor5-engine/tests/view/position.js
  28. 1 1
      packages/ckeditor5-engine/tests/view/renderer.js
  29. 4 4
      packages/ckeditor5-engine/tests/view/selection.js
  30. 4 4
      packages/ckeditor5-engine/tests/view/treewalker.js

+ 1 - 1
packages/ckeditor5-engine/src/model/batch.js

@@ -145,7 +145,7 @@ export function register( name, creator ) {
 		 * @param {String} name
 		 */
 		throw new CKEditorError(
-			'batch-register-taken: This batch method name is already taken.',
+			'model-batch-register-taken: This batch method name is already taken.',
 			{ name: name } );
 	}
 

+ 3 - 3
packages/ckeditor5-engine/src/model/document.js

@@ -142,7 +142,7 @@ export default class Document {
 			 * @param {engine.model.operation.Operation} operation
 			 */
 			throw new CKEditorError(
-				'document-applyOperation-wrong-version: Only operations with matching versions can be applied.',
+				'model-document-applyOperation-wrong-version: Only operations with matching versions can be applied.',
 				{ operation: operation } );
 		}
 
@@ -189,7 +189,7 @@ export default class Document {
 			 * @param {String} name
 			 */
 			throw new CKEditorError(
-				'document-createRoot-name-exists: Root with specified name already exists.',
+				'model-document-createRoot-name-exists: Root with specified name already exists.',
 				{ name: rootName }
 			);
 		}
@@ -247,7 +247,7 @@ export default class Document {
 			 * @param {String} name
 			 */
 			throw new CKEditorError(
-				'document-getRoot-root-not-exist: Root with specified name does not exist.',
+				'model-document-getRoot-root-not-exist: Root with specified name does not exist.',
 				{ name: name }
 			);
 		}

+ 1 - 1
packages/ckeditor5-engine/src/model/history.js

@@ -200,7 +200,7 @@ export default class History {
 			 *
 			 * @error history-wrong-version
 			 */
-			throw new CKEditorError( 'history-wrong-version: Given base version points to the middle of a delta.' );
+			throw new CKEditorError( 'model-history-wrong-version: Given base version points to the middle of a delta.' );
 		}
 
 		return index;

+ 1 - 1
packages/ckeditor5-engine/src/model/liveposition.js

@@ -40,7 +40,7 @@ export default class LivePosition extends Position {
 			 *
 			 * @error liveposition-root-not-rootelement
 			 */
-			throw new CKEditorError( 'liveposition-root-not-rootelement: LivePosition root has to be an instance of RootElement.' );
+			throw new CKEditorError( 'model-liveposition-root-not-rootelement: LivePosition root has to be an instance of RootElement.' );
 		}
 
 		super( root, path );

+ 2 - 2
packages/ckeditor5-engine/src/model/node.js

@@ -85,7 +85,7 @@ export default class Node {
 			 *
 			 * @error node-not-found-in-parent
 			 */
-			throw new CKEditorError( 'node-not-found-in-parent: The node\'s parent does not contain this node.' );
+			throw new CKEditorError( 'model-node-not-found-in-parent: The node\'s parent does not contain this node.' );
 		}
 
 		return pos;
@@ -114,7 +114,7 @@ export default class Node {
 			 *
 			 * @error node-not-found-in-parent
 			 */
-			throw new CKEditorError( 'node-not-found-in-parent: The node\'s parent does not contain this node.' );
+			throw new CKEditorError( 'model-node-not-found-in-parent: The node\'s parent does not contain this node.' );
 		}
 
 		return pos;

+ 5 - 5
packages/ckeditor5-engine/src/model/nodelist.js

@@ -98,7 +98,7 @@ export default class NodeList {
 	 * Converts index to offset in node list.
 	 *
 	 * Returns starting offset of a node that is at given index. Throws {@link utils.CKEditorError CKEditorError}
-	 * `nodelist-index-out-of-bounds` if given index is less than `0` or more than {@link engine.model.NodeList#length}.
+	 * `model-nodelist-index-out-of-bounds` if given index is less than `0` or more than {@link engine.model.NodeList#length}.
 	 *
 	 * @param {Number} index Node's index.
 	 * @returns {Number} Node's starting offset.
@@ -116,7 +116,7 @@ export default class NodeList {
 			 *
 			 * @error nodelist-index-out-of-bounds
 			 */
-			throw new CKEditorError( 'nodelist-index-out-of-bounds: Given index cannot be found in the node list.' );
+			throw new CKEditorError( 'model-nodelist-index-out-of-bounds: Given index cannot be found in the node list.' );
 		}
 
 		return this.getNodeStartOffset( node );
@@ -126,7 +126,7 @@ export default class NodeList {
 	 * Converts offset in node list to index.
 	 *
 	 * Returns index of a node that occupies given offset. Throws {@link utils.CKEditorError CKEditorError}
-	 * `nodelist-offset-out-of-bounds` if given offset is less than `0` or more than {@link engine.model.NodeList#getMaxOffset}.
+	 * `model-nodelist-offset-out-of-bounds` if given offset is less than `0` or more than {@link engine.model.NodeList#getMaxOffset}.
 	 *
 	 * @param {Number} offset Offset to look for.
 	 * @returns {Number} Index of a node that occupies given offset.
@@ -148,7 +148,7 @@ export default class NodeList {
 			 *
 			 * @error nodelist-offset-out-of-bounds
 			 */
-			throw new CKEditorError( 'nodelist-offset-out-of-bounds: Given offset cannot be found in the node list.' );
+			throw new CKEditorError( 'model-nodelist-offset-out-of-bounds: Given offset cannot be found in the node list.' );
 		}
 
 		return this.length;
@@ -169,7 +169,7 @@ export default class NodeList {
 				 *
 				 * @error nodelist-insertNodes-not-node
 				 */
-				throw new CKEditorError( 'nodelist-insertNodes-not-node: Trying to insert an object which is not a Node instance.' );
+				throw new CKEditorError( 'model-nodelist-insertNodes-not-node: Trying to insert an object which is not a Node instance.' );
 			}
 		}
 

+ 1 - 1
packages/ckeditor5-engine/src/model/operation/attributeoperation.js

@@ -115,7 +115,7 @@ export default class AttributeOperation extends Operation {
 				 * @param {String} key
 				 */
 				throw new CKEditorError(
-					'operation-attribute-wrong-old-value: Changed node has different attribute value than operation\'s old attribute value.',
+					'attribute-operation-wrong-old-value: Changed node has different attribute value than operation\'s old attribute value.',
 					{ item: item, key: this.key }
 				);
 			}

+ 6 - 6
packages/ckeditor5-engine/src/model/position.js

@@ -46,7 +46,7 @@ export default class Position {
 			 *
 			 * @error position-root-invalid.
 			 */
-			throw new CKEditorError( 'position-root-invalid: Position root invalid.' );
+			throw new CKEditorError( 'model-position-root-invalid: Position root invalid.' );
 		}
 
 		if ( !( path instanceof Array ) || path.length === 0 ) {
@@ -56,7 +56,7 @@ export default class Position {
 			 * @error position-path-incorrect
 			 * @param path
 			 */
-			throw new CKEditorError( 'position-path-incorrect: Position path must be an Array with at least one item.', { path: path } );
+			throw new CKEditorError( 'model-position-path-incorrect: Position path must be an Array with at least one item.', { path: path } );
 		}
 
 		// Normalize the root and path (if element was passed).
@@ -601,7 +601,7 @@ export default class Position {
 			 * @error position-after-root
 			 * @param {engine.model.Item} root
 			 */
-			throw new CKEditorError( 'position-after-root: You can not make position after root.', { root: item } );
+			throw new CKEditorError( 'model-position-after-root: You can not make position after root.', { root: item } );
 		}
 
 		return this.createFromParentAndOffset( item.parent, item.endOffset );
@@ -621,7 +621,7 @@ export default class Position {
 			 * @error position-before-root
 			 * @param {engine.model.Item} root
 			 */
-			throw new CKEditorError( 'position-before-root: You can not make position before root.', { root: item } );
+			throw new CKEditorError( 'model-position-before-root: You can not make position before root.', { root: item } );
 		}
 
 		return this.createFromParentAndOffset( item.parent, item.startOffset );
@@ -641,7 +641,7 @@ export default class Position {
 			 *
 			 * @error position-parent-incorrect
 			 */
-			throw new CKEditorError( 'position-parent-incorrect: Position parent have to be a element or document fragment.' );
+			throw new CKEditorError( 'model-position-parent-incorrect: Position parent have to be a element or document fragment.' );
 		}
 
 		const path = parent.getPath();
@@ -680,7 +680,7 @@ export default class Position {
 			 * @param {String} rootName
 			 */
 			throw new CKEditorError(
-				'position-fromjson-no-root: Cannot create position for document. Root with specified name does not exist.',
+				'model-position-fromjson-no-root: Cannot create position for document. Root with specified name does not exist.',
 				{ rootName: json.root }
 			);
 		}

+ 3 - 3
packages/ckeditor5-engine/src/model/schema.js

@@ -440,7 +440,7 @@ export default class Schema {
 			 *
 			 * @error schema-item-exists
 			 */
-			throw new CKEditorError( 'schema-item-exists: Item with specified name already exists in schema.' );
+			throw new CKEditorError( 'model-schema-item-exists: Item with specified name already exists in schema.' );
 		}
 
 		if ( !!isExtending && !this.hasItem( isExtending ) ) {
@@ -449,7 +449,7 @@ export default class Schema {
 			 *
 			 * @error schema-no-item
 			 */
-			throw new CKEditorError( 'schema-no-item: Item with specified name does not exist in schema.' );
+			throw new CKEditorError( 'model-schema-no-item: Item with specified name does not exist in schema.' );
 		}
 
 		// Create new SchemaItem and add it to the items store.
@@ -479,7 +479,7 @@ export default class Schema {
 			 *
 			 * @error schema-no-item
 			 */
-			throw new CKEditorError( 'schema-no-item: Item with specified name does not exist in schema.' );
+			throw new CKEditorError( 'model-schema-no-item: Item with specified name does not exist in schema.' );
 		}
 
 		return this._items.get( itemName );

+ 3 - 3
packages/ckeditor5-engine/src/model/selection.js

@@ -443,7 +443,7 @@ export default class Selection {
 			 *
 			 * @error selection-setFocus-no-ranges
 			 */
-			throw new CKEditorError( 'selection-setFocus-no-ranges: Cannot set selection focus if there are no ranges in selection.' );
+			throw new CKEditorError( 'model-selection-setFocus-no-ranges: Cannot set selection focus if there are no ranges in selection.' );
 		}
 
 		const newFocus = Position.createAt( itemOrPosition, offset );
@@ -488,7 +488,7 @@ export default class Selection {
 	 */
 	_pushRange( range ) {
 		if ( !( range instanceof Range ) ) {
-			throw new CKEditorError( 'selection-added-not-range: Trying to add an object that is not an instance of Range.' );
+			throw new CKEditorError( 'model-selection-added-not-range: Trying to add an object that is not an instance of Range.' );
 		}
 
 		this._checkRange( range );
@@ -512,7 +512,7 @@ export default class Selection {
 				 * @param {engine.model.Range} intersectingRange Range from selection that intersects with `addedRange`.
 				 */
 				throw new CKEditorError(
-					'selection-range-intersects: Trying to add a range that intersects with another range from selection.',
+					'model-selection-range-intersects: Trying to add a range that intersects with another range from selection.',
 					{ addedRange: range, intersectingRange: this._ranges[ i ] }
 				);
 			}

+ 2 - 2
packages/ckeditor5-engine/src/model/treewalker.js

@@ -40,14 +40,14 @@ export default class TreeWalker {
 			 *
 			 * @error tree-walker-no-start-position
 			 */
-			throw new CKEditorError( 'tree-walker-no-start-position: Neither boundaries nor starting position have been defined.' );
+			throw new CKEditorError( 'model-tree-walker-no-start-position: Neither boundaries nor starting position have been defined.' );
 		}
 
 		const direction = options.direction || 'forward';
 
 		if ( direction != 'forward' && direction != 'backward' ) {
 			throw new CKEditorError(
-				'tree-walker-unknown-direction: Only `backward` and `forward` direction allowed.',
+				'model-tree-walker-unknown-direction: Only `backward` and `forward` direction allowed.',
 				{ direction }
 			);
 		}

+ 2 - 2
packages/ckeditor5-engine/src/view/position.js

@@ -304,7 +304,7 @@ export default class Position {
 			 * @error position-after-root
 			 * @param {engine.view.Node} root
 			 */
-			throw new CKEditorError( 'position-after-root: You can not make position after root.', { root: item } );
+			throw new CKEditorError( 'view-position-after-root: You can not make position after root.', { root: item } );
 		}
 
 		return new Position( item.parent, item.index + 1 );
@@ -329,7 +329,7 @@ export default class Position {
 			 * @error position-before-root
 			 * @param {engine.view.Node} root
 			 */
-			throw new CKEditorError( 'position-before-root: You can not make position before root.', { root: item } );
+			throw new CKEditorError( 'view-position-before-root: You can not make position before root.', { root: item } );
 		}
 
 		return new Position( item.parent, item.index );

+ 2 - 2
packages/ckeditor5-engine/src/view/renderer.js

@@ -137,7 +137,7 @@ export default class Renderer {
 				 *
 				 * @error renderer-unknown-type
 				 */
-				throw new CKEditorError( 'renderer-unknown-type: Unknown type passed to Renderer.markToSync.' );
+				throw new CKEditorError( 'view-renderer-unknown-type: Unknown type passed to Renderer.markToSync.' );
 			}
 		}
 	}
@@ -254,7 +254,7 @@ export default class Renderer {
 			 *
 			 * @error renderer-render-no-inline-filler.
 			 */
-			throw new CKEditorError( 'renderer-render-no-inline-filler: No inline filler on expected position.' );
+			throw new CKEditorError( 'view-renderer-render-no-inline-filler: No inline filler on expected position.' );
 		}
 
 		if ( isInlineFiller( domFillerNode ) ) {

+ 5 - 5
packages/ckeditor5-engine/src/view/selection.js

@@ -134,7 +134,7 @@ export default class Selection {
 	 * The flag is used to set {@link engine.view.Selection#anchor anchor} and
 	 * {@link engine.view.Selection#focus focus} properties.
 	 *
-	 * Throws {@link utils.CKEditorError CKEditorError} `selection-range-intersects` if added range intersects
+	 * Throws {@link utils.CKEditorError CKEditorError} `view-selection-range-intersects` if added range intersects
 	 * with ranges already stored in Selection instance.
 	 *
 	 * @fires engine.view.Selection#change
@@ -142,7 +142,7 @@ export default class Selection {
 	 */
 	addRange( range, isBackward ) {
 		if ( !( range instanceof Range ) ) {
-			throw new CKEditorError( 'selection-invalid-range: Invalid Range.' );
+			throw new CKEditorError( 'view-selection-invalid-range: Invalid Range.' );
 		}
 
 		this._pushRange( range );
@@ -276,7 +276,7 @@ export default class Selection {
 
 		for ( let range of newRanges ) {
 			if ( !( range instanceof Range ) ) {
-				throw new CKEditorError( 'selection-invalid-range: Invalid Range.' );
+				throw new CKEditorError( 'view-selection-invalid-range: Invalid Range.' );
 			}
 
 			this._pushRange( range );
@@ -359,7 +359,7 @@ export default class Selection {
 	/**
 	 * Adds range to selection - creates copy of given range so it can be safely used and modified.
 	 *
-	 * Throws {@link utils.CKEditorError CKEditorError} `selection-range-intersects` if added range intersects
+	 * Throws {@link utils.CKEditorError CKEditorError} `view-selection-range-intersects` if added range intersects
 	 * with ranges already stored in selection instance.
 	 *
 	 * @private
@@ -376,7 +376,7 @@ export default class Selection {
 				 * @param {engine.view.Range} intersectingRange Range from selection that intersects with `addedRange`.
 				 */
 				throw new CKEditorError(
-					'selection-range-intersects: Trying to add a range that intersects with another range from selection.',
+					'view-selection-range-intersects: Trying to add a range that intersects with another range from selection.',
 					{ addedRange: range, intersectingRange: storedRange }
 				);
 			}

+ 2 - 2
packages/ckeditor5-engine/src/view/treewalker.js

@@ -40,12 +40,12 @@ export default class TreeWalker {
 			 *
 			 * @error tree-walker-no-start-position
 			 */
-			throw new CKEditorError( 'tree-walker-no-start-position: Neither boundaries nor starting position have been defined.' );
+			throw new CKEditorError( 'view-tree-walker-no-start-position: Neither boundaries nor starting position have been defined.' );
 		}
 
 		if ( options.direction && options.direction != 'forward' && options.direction != 'backward' ) {
 			throw new CKEditorError(
-				'tree-walker-unknown-direction: Only `backward` and `forward` direction allowed.',
+				'view-tree-walker-unknown-direction: Only `backward` and `forward` direction allowed.',
 				{ direction: options.direction }
 			);
 		}

+ 1 - 1
packages/ckeditor5-engine/tests/model/batch.js

@@ -58,7 +58,7 @@ describe( 'Batch', () => {
 
 			expect( () => {
 				register( 'foo', () => {} );
-			} ).to.throw( CKEditorError, /^batch-register-taken/ );
+			} ).to.throw( CKEditorError, /^model-batch-register-taken/ );
 		} );
 	} );
 

+ 3 - 3
packages/ckeditor5-engine/tests/model/document/document.js

@@ -76,7 +76,7 @@ describe( 'Document', () => {
 				() => {
 					doc.createRoot( '$root', 'rootName' );
 				}
-			).to.throw( CKEditorError, /document-createRoot-name-exists/ );
+			).to.throw( CKEditorError, /model-document-createRoot-name-exists/ );
 		} );
 	} );
 
@@ -93,7 +93,7 @@ describe( 'Document', () => {
 				() => {
 					doc.getRoot( 'root' );
 				}
-			).to.throw( CKEditorError, /document-getRoot-root-not-exist/ );
+			).to.throw( CKEditorError, /model-document-getRoot-root-not-exist/ );
 		} );
 	} );
 
@@ -147,7 +147,7 @@ describe( 'Document', () => {
 				() => {
 					doc.applyOperation( operation );
 				}
-			).to.throw( CKEditorError, /document-applyOperation-wrong-version/ );
+			).to.throw( CKEditorError, /model-document-applyOperation-wrong-version/ );
 		} );
 	} );
 

+ 1 - 1
packages/ckeditor5-engine/tests/model/history.js

@@ -130,7 +130,7 @@ describe( 'History', () => {
 		it( 'should throw if given history point is "inside" delta', () => {
 			expect( () => {
 				Array.from( history.getDeltas( 2 ) );
-			} ).to.throw( CKEditorError, /history-wrong-version/ );
+			} ).to.throw( CKEditorError, /model-history-wrong-version/ );
 		} );
 	} );
 

+ 1 - 1
packages/ckeditor5-engine/tests/model/liveposition.js

@@ -39,7 +39,7 @@ describe( 'LivePosition', () => {
 	it( 'should throw if given root is not a RootElement', () => {
 		expect( () => {
 			new LivePosition( new DocumentFragment(), [ 1 ] );
-		} ).to.throw( CKEditorError, /liveposition-root-not-rootelement/ );
+		} ).to.throw( CKEditorError, /model-liveposition-root-not-rootelement/ );
 	} );
 
 	it( 'should listen to a change event of the document that owns this position root', () => {

+ 2 - 2
packages/ckeditor5-engine/tests/model/node.js

@@ -132,7 +132,7 @@ describe( 'Node', () => {
 				() => {
 					node.index;
 				}
-			).to.throw( CKEditorError, /node-not-found-in-parent/ );
+			).to.throw( CKEditorError, /model-node-not-found-in-parent/ );
 		} );
 	} );
 
@@ -186,7 +186,7 @@ describe( 'Node', () => {
 				() => {
 					node.startOffset;
 				}
-			).to.throw( CKEditorError, /node-not-found-in-parent/ );
+			).to.throw( CKEditorError, /model-node-not-found-in-parent/ );
 		} );
 	} );
 

+ 2 - 2
packages/ckeditor5-engine/tests/model/nodelist.js

@@ -87,11 +87,11 @@ describe( 'NodeList', () => {
 		it( 'should throw if given offset is too high or too low', () => {
 			expect( () => {
 				nodes.indexToOffset( -1 );
-			} ).to.throw( CKEditorError, /nodelist-index-out-of-bounds/ );
+			} ).to.throw( CKEditorError, /model-nodelist-index-out-of-bounds/ );
 
 			expect( () => {
 				nodes.indexToOffset( 99 );
-			} ).to.throw( CKEditorError, /nodelist-index-out-of-bounds/ );
+			} ).to.throw( CKEditorError, /model-nodelist-index-out-of-bounds/ );
 		} );
 
 		it( 'should return length if given offset is equal to maxOffset', () => {

+ 1 - 1
packages/ckeditor5-engine/tests/model/operation/attributeoperation.js

@@ -296,7 +296,7 @@ describe( 'AttributeOperation', () => {
 					doc.version
 				)
 			) );
-		} ).to.throw( CKEditorError, /operation-attribute-wrong-old-value/ );
+		} ).to.throw( CKEditorError, /attribute-operation-wrong-old-value/ );
 	} );
 
 	it( 'should throw an error when one try to insert and the attribute already exists', () => {

+ 8 - 8
packages/ckeditor5-engine/tests/model/position.js

@@ -102,21 +102,21 @@ describe( 'position', () => {
 		it( 'should throw error if given path is incorrect', () => {
 			expect( () => {
 				new Position( root, {} );
-			} ).to.throw( CKEditorError, /position-path-incorrect/ );
+			} ).to.throw( CKEditorError, /model-position-path-incorrect/ );
 
 			expect( () => {
 				new Position( root, [] );
-			} ).to.throw( CKEditorError, /position-path-incorrect/ );
+			} ).to.throw( CKEditorError, /model-position-path-incorrect/ );
 		} );
 
 		it( 'should throw error if given root is invalid', () => {
 			expect( () => {
 				new Position( new Text( 'a' ) );
-			} ).to.throw( CKEditorError, /position-root-invalid/ );
+			} ).to.throw( CKEditorError, /model-position-root-invalid/ );
 
 			expect( () => {
 				new Position();
-			} ).to.throw( CKEditorError, /position-root-invalid/ );
+			} ).to.throw( CKEditorError, /model-position-root-invalid/ );
 		} );
 	} );
 
@@ -141,7 +141,7 @@ describe( 'position', () => {
 		it( 'throws when parent is not an element', () => {
 			expect( () => {
 				Position.createFromParentAndOffset( b, 0 );
-			} ).to.throw( CKEditorError, /^position-parent-incorrect/ );
+			} ).to.throw( CKEditorError, /^model-position-parent-incorrect/ );
 		} );
 
 		it( 'works with a doc frag', () => {
@@ -201,7 +201,7 @@ describe( 'position', () => {
 		it( 'should throw error if one try to create positions before root', () => {
 			expect( () => {
 				Position.createBefore( root );
-			} ).to.throw( CKEditorError, /position-before-root/ );
+			} ).to.throw( CKEditorError, /model-position-before-root/ );
 		} );
 	} );
 
@@ -227,7 +227,7 @@ describe( 'position', () => {
 		it( 'should throw error if one try to make positions after root', () => {
 			expect( () => {
 				Position.createAfter( root );
-			} ).to.throw( CKEditorError, /position-after-root/ );
+			} ).to.throw( CKEditorError, /model-position-after-root/ );
 		} );
 	} );
 
@@ -763,7 +763,7 @@ describe( 'position', () => {
 				() => {
 					Position.fromJSON( { root: 'noroot', path: [ 0 ] }, doc );
 				}
-			).to.throw( CKEditorError, /position-fromjson-no-root/ );
+			).to.throw( CKEditorError, /model-position-fromjson-no-root/ );
 		} );
 	} );
 } );

+ 3 - 3
packages/ckeditor5-engine/tests/model/schema/schema.js

@@ -71,13 +71,13 @@ describe( 'registerItem', () => {
 
 		expect( () => {
 			schema.registerItem( 'new' );
-		} ).to.throw( CKEditorError, /schema-item-exists/ );
+		} ).to.throw( CKEditorError, /model-schema-item-exists/ );
 	} );
 
 	it( 'should throw if base item has not been registered in schema', () => {
 		expect( () => {
 			schema.registerItem( 'new', 'old' );
-		} ).to.throw( CKEditorError, /schema-no-item/ );
+		} ).to.throw( CKEditorError, /model-schema-no-item/ );
 	} );
 } );
 
@@ -103,7 +103,7 @@ describe( '_getItem', () => {
 	it( 'should throw if there is no item registered under given name', () => {
 		expect( () => {
 			schema._getItem( 'new' );
-		} ).to.throw( CKEditorError, /schema-no-item/ );
+		} ).to.throw( CKEditorError, /model-schema-no-item/ );
 	} );
 } );
 

+ 4 - 4
packages/ckeditor5-engine/tests/model/selection.js

@@ -109,7 +109,7 @@ describe( 'Selection', () => {
 		it( 'should throw an error when range is invalid', () => {
 			expect( () => {
 				selection.addRange( { invalid: 'Range' } );
-			} ).to.throw( CKEditorError, /selection-added-not-range/ );
+			} ).to.throw( CKEditorError, /model-selection-added-not-range/ );
 		} );
 
 		it( 'should copy added ranges and store multiple ranges', () => {
@@ -179,7 +179,7 @@ describe( 'Selection', () => {
 						new Position( root, [ 1, 2 ] )
 					)
 				);
-			} ).to.throw( CKEditorError, /selection-range-intersects/ );
+			} ).to.throw( CKEditorError, /model-selection-range-intersects/ );
 		} );
 	} );
 
@@ -315,7 +315,7 @@ describe( 'Selection', () => {
 
 			expect( () => {
 				selection.setFocus( endPos );
-			} ).to.throw( CKEditorError, /selection-setFocus-no-ranges/ );
+			} ).to.throw( CKEditorError, /model-selection-setFocus-no-ranges/ );
 		} );
 
 		it( 'modifies existing collapsed selection', () => {
@@ -503,7 +503,7 @@ describe( 'Selection', () => {
 		it( 'should throw an error when range is invalid', () => {
 			expect( () => {
 				selection.setRanges( [ { invalid: 'range' } ] );
-			} ).to.throw( CKEditorError, /selection-added-not-range/ );
+			} ).to.throw( CKEditorError, /model-selection-added-not-range/ );
 		} );
 
 		it( 'should remove all ranges and add given ranges', () => {

+ 4 - 4
packages/ckeditor5-engine/tests/model/treewalker.js

@@ -50,21 +50,21 @@ describe( 'TreeWalker', () => {
 		it( 'should throw if neither boundaries nor starting position is set', () => {
 			expect( () => {
 				new TreeWalker();
-			} ).to.throw( CKEditorError, /^tree-walker-no-start-position/ );
+			} ).to.throw( CKEditorError, /^model-tree-walker-no-start-position/ );
 
 			expect( () => {
 				new TreeWalker( {} );
-			} ).to.throw( CKEditorError, /^tree-walker-no-start-position/ );
+			} ).to.throw( CKEditorError, /^model-tree-walker-no-start-position/ );
 
 			expect( () => {
 				new TreeWalker( { singleCharacters: true } );
-			} ).to.throw( CKEditorError, /^tree-walker-no-start-position/ );
+			} ).to.throw( CKEditorError, /^model-tree-walker-no-start-position/ );
 		} );
 
 		it( 'should throw if walking direction is unknown', () => {
 			expect( () => {
 				new TreeWalker( { startPosition: rootBeginning, direction: 'unknown' } );
-			} ).to.throw( CKEditorError, /^tree-walker-unknown-direction/ );
+			} ).to.throw( CKEditorError, /^model-tree-walker-unknown-direction/ );
 		} );
 	} );
 

+ 2 - 2
packages/ckeditor5-engine/tests/view/position.js

@@ -403,7 +403,7 @@ describe( 'Position', () => {
 		it( 'should throw error if one try to create positions before root', () => {
 			expect( () => {
 				Position.createBefore( parse( '<p></p>' ) );
-			} ).to.throw( CKEditorError, /position-before-root/ );
+			} ).to.throw( CKEditorError, /view-position-before-root/ );
 		} );
 
 		it( 'should create positions before `Node`', () => {
@@ -428,7 +428,7 @@ describe( 'Position', () => {
 		it( 'should throw error if one try to create positions after root', () => {
 			expect( () => {
 				Position.createAfter( parse( '<p></p>' ) );
-			} ).to.throw( CKEditorError, /position-after-root/ );
+			} ).to.throw( CKEditorError, /view-position-after-root/ );
 		} );
 
 		it( 'should create positions after `Node`', () => {

+ 1 - 1
packages/ckeditor5-engine/tests/view/renderer.js

@@ -97,7 +97,7 @@ describe( 'Renderer', () => {
 		it( 'should throw if the type is unknown', () => {
 			expect( () => {
 				renderer.markToSync( 'UNKNOWN', viewRoot );
-			} ).to.throw( CKEditorError, /^renderer-unknown-type/ );
+			} ).to.throw( CKEditorError, /^view-renderer-unknown-type/ );
 		} );
 	} );
 

+ 4 - 4
packages/ckeditor5-engine/tests/view/selection.js

@@ -147,7 +147,7 @@ describe( 'Selection', () => {
 		it( 'should throw an error when range is invalid', () => {
 			expect( () => {
 				selection.addRange( { invalid: 'range' } );
-			} ).to.throw( CKEditorError, 'selection-invalid-range: Invalid Range.' );
+			} ).to.throw( CKEditorError, 'view-selection-invalid-range: Invalid Range.' );
 		} );
 
 		it( 'should add range to selection ranges', () => {
@@ -169,11 +169,11 @@ describe( 'Selection', () => {
 			selection.addRange( range1 );
 			expect( () => {
 				selection.addRange( range2 );
-			} ).to.throw( CKEditorError, 'selection-range-intersects' );
+			} ).to.throw( CKEditorError, 'view-selection-range-intersects' );
 
 			expect( () => {
 				selection.addRange( range1 );
-			} ).to.throw( CKEditorError, 'selection-range-intersects' );
+			} ).to.throw( CKEditorError, 'view-selection-range-intersects' );
 		} );
 	} );
 
@@ -337,7 +337,7 @@ describe( 'Selection', () => {
 		it( 'should throw an error when range is invalid', () => {
 			expect( () => {
 				selection.setRanges( [ { invalid: 'range' } ] );
-			} ).to.throw( CKEditorError, 'selection-invalid-range: Invalid Range.' );
+			} ).to.throw( CKEditorError, 'view-selection-invalid-range: Invalid Range.' );
 		} );
 
 		it( 'should add ranges and fire change event', ( done ) => {

+ 4 - 4
packages/ckeditor5-engine/tests/view/treewalker.js

@@ -56,21 +56,21 @@ describe( 'TreeWalker', () => {
 		it( 'should throw if neither boundaries nor starting position is set', () => {
 			expect( () => {
 				new TreeWalker();
-			} ).to.throw( CKEditorError, /^tree-walker-no-start-position/ );
+			} ).to.throw( CKEditorError, /^view-tree-walker-no-start-position/ );
 
 			expect( () => {
 				new TreeWalker( {} );
-			} ).to.throw( CKEditorError, /^tree-walker-no-start-position/ );
+			} ).to.throw( CKEditorError, /^view-tree-walker-no-start-position/ );
 
 			expect( () => {
 				new TreeWalker( { singleCharacters: true } );
-			} ).to.throw( CKEditorError, /^tree-walker-no-start-position/ );
+			} ).to.throw( CKEditorError, /^view-tree-walker-no-start-position/ );
 		} );
 
 		it( 'should throw if walking direction is unknown', () => {
 			expect( () => {
 				new TreeWalker( { startPosition: rootBeginning, direction: 'unknown' } );
-			} ).to.throw( CKEditorError, /^tree-walker-unknown-direction/ );
+			} ).to.throw( CKEditorError, /^view-tree-walker-unknown-direction/ );
 		} );
 	} );