Sfoglia il codice sorgente

Merge pull request #30 from ckeditor/i/1803

Docs: Error messages in manual tests and a sample should be more verbose should the editor fail to initialize (see ckeditor/ckeditor5#1803).
Aleksander Nowodzinski 6 anni fa
parent
commit
4dff2318f9

+ 10 - 10
packages/ckeditor5-build-decoupled-document/README.md

@@ -45,8 +45,8 @@ And use it in your website:
 
 			window.editor = editor;
 		} )
-		.catch( err => {
-			console.error( err.stack );
+		.catch( error => {
+			console.error( 'There was a problem initializing the editor.', error );
 		} );
 </script>
 ```
@@ -61,14 +61,14 @@ import DecoupledEditor from '@ckeditor/ckeditor5-build-decoupled-document';
 
 DecoupledEditor
 	.create( document.querySelector( '#editor' ) )
-		.then( editor => {
-			// The toolbar needs to be explicitly appended.
-			document.querySelector( '#toolbar-container' ).appendChild( editor.ui.view.toolbar.element );
-
-			window.editor = editor;
-		} )
-	.catch( err => {
-		console.error( err.stack );
+	.then( editor => {
+		// The toolbar needs to be explicitly appended.
+		document.querySelector( '#toolbar-container' ).appendChild( editor.ui.view.toolbar.element );
+
+		window.editor = editor;
+	} )
+	.catch( error => {
+		console.error( 'There was a problem initializing the editor.', error );
 	} );
 ```
 

+ 8 - 8
packages/ckeditor5-build-decoupled-document/sample/index.html

@@ -58,15 +58,15 @@
 		<p>You can use this sample to validate whether your <a href="https://ckeditor.com/docs/ckeditor5/latest/builds/guides/development/custom-builds.html">custom build</a> works fine.</p>`;
 
 	DecoupledEditor.create( editorData )
-	.then( editor => {
-		window.editor = editor;
+		.then( editor => {
+			window.editor = editor;
 
-		document.querySelector( '.toolbar-container' ).appendChild( editor.ui.view.toolbar.element );
-		document.querySelector( '.editable-container' ).appendChild( editor.ui.view.editable.element );
-	} )
-	.catch( err => {
-		console.error( err.stack );
-	} );
+			document.querySelector( '.toolbar-container' ).appendChild( editor.ui.view.toolbar.element );
+			document.querySelector( '.editable-container' ).appendChild( editor.ui.view.editable.element );
+		} )
+		.catch( error => {
+			console.error( 'There was a problem initializing the editor.', error );
+		} );
 </script>
 
 </body>

+ 2 - 2
packages/ckeditor5-build-decoupled-document/tests/manual/ckeditor-cjs-version.js

@@ -14,6 +14,6 @@ DecoupledEditor.create( document.querySelector( '#editor' ) )
 
 		window.editor = editor;
 	} )
-	.catch( err => {
-		console.error( err.stack );
+	.catch( error => {
+		console.error( 'There was a problem initializing the editor.', error );
 	} );

+ 2 - 2
packages/ckeditor5-build-decoupled-document/tests/manual/ckeditor.js

@@ -13,6 +13,6 @@ DecoupledEditor.create( document.querySelector( '#editor' ) )
 
 		window.editor = editor;
 	} )
-	.catch( err => {
-		console.error( err.stack );
+	.catch( error => {
+		console.error( 'There was a problem initializing the editor.', error );
 	} );