|
|
@@ -177,8 +177,16 @@ export default class Writer {
|
|
|
// If it isn't the same root.
|
|
|
else {
|
|
|
if ( item.root.document ) {
|
|
|
- // It is forbidden to move a node that was already in a document outside of it.
|
|
|
- throw new Error( 'model-writer-insert-forbidden-move: Cannot move a node from a document to a different tree.' );
|
|
|
+ /**
|
|
|
+ * Cannot move a node from a document to a different tree.
|
|
|
+ * It is forbidden to move a node that was already in a document outside of it.
|
|
|
+ *
|
|
|
+ * @error model-writer-insert-forbidden-move
|
|
|
+ */
|
|
|
+ throw new CKEditorError(
|
|
|
+ 'model-writer-insert-forbidden-move: ' +
|
|
|
+ 'Cannot move a node from a document to a different tree. ' +
|
|
|
+ 'It is forbidden to move a node that was already in a document outside of it.' );
|
|
|
} else {
|
|
|
// Move between two different document fragments or from document fragment to a document is possible.
|
|
|
// In that case, remove the item from it's original parent.
|