8
0
Maciej Bukowski 6 лет назад
Родитель
Сommit
a49a1e1dd1

+ 8 - 2
packages/ckeditor5-mention/src/mentioncommand.js

@@ -98,7 +98,10 @@ export default class MentionCommand extends Command {
 			 *
 			 * @error mentioncommand-incorrect-marker
 			 */
-			throw new CKEditorError( 'mentioncommand-incorrect-marker: The marker must be a single character.' );
+			throw new CKEditorError(
+				'mentioncommand-incorrect-marker: The marker must be a single character.',
+				this
+			);
 		}
 
 		if ( mentionID.charAt( 0 ) != options.marker ) {
@@ -127,7 +130,10 @@ export default class MentionCommand extends Command {
 			 *
 			 * @error mentioncommand-incorrect-id
 			 */
-			throw new CKEditorError( 'mentioncommand-incorrect-id: The item id must start with the marker character.' );
+			throw new CKEditorError(
+				'mentioncommand-incorrect-id: The item id must start with the marker character.',
+				this
+			);
 		}
 
 		model.change( writer => {

+ 4 - 1
packages/ckeditor5-mention/src/mentionui.js

@@ -128,7 +128,10 @@ export default class MentionUI extends Plugin {
 				 *
 				 * @error mentionconfig-incorrect-marker
 				 */
-				throw new CKEditorError( 'mentionconfig-incorrect-marker: The marker must be provided and it must be a single character.' );
+				throw new CKEditorError(
+					'mentionconfig-incorrect-marker: The marker must be provided and it must be a single character.',
+					null
+				);
 			}
 
 			const minimumCharacters = mentionDescription.minimumCharacters || 0;

+ 3 - 3
packages/ckeditor5-mention/tests/mentionui.js

@@ -67,19 +67,19 @@ describe( 'MentionUI', () => {
 	describe( 'init()', () => {
 		it( 'should throw if marker was not provided for feed', () => {
 			return createClassicTestEditor( { feeds: [ { feed: [ 'a' ] } ] } ).catch( error => {
-				assertCKEditorError( error, /mentionconfig-incorrect-marker/, editor );
+				assertCKEditorError( error, /mentionconfig-incorrect-marker/, null );
 			} );
 		} );
 
 		it( 'should throw if marker is empty string', () => {
 			return createClassicTestEditor( { feeds: [ { marker: '', feed: [ 'a' ] } ] } ).catch( error => {
-				assertCKEditorError( error, /mentionconfig-incorrect-marker/, editor );
+				assertCKEditorError( error, /mentionconfig-incorrect-marker/, null );
 			} );
 		} );
 
 		it( 'should throw if marker is longer then 1 character', () => {
 			return createClassicTestEditor( { feeds: [ { marker: '$$', feed: [ 'a' ] } ] } ).catch( error => {
-				assertCKEditorError( error, /mentionconfig-incorrect-marker/, editor );
+				assertCKEditorError( error, /mentionconfig-incorrect-marker/, null );
 			} );
 		} );
 	} );