Przeglądaj źródła

Handling rejected promises in dev tasks.

Szymon Kupś 10 lat temu
rodzic
commit
a26079ac4f
1 zmienionych plików z 6 dodań i 2 usunięć
  1. 6 2
      dev/tasks/dev.js

+ 6 - 2
dev/tasks/dev.js

@@ -24,13 +24,17 @@ module.exports = ( grunt ) => {
 	grunt.registerTask( 'dev-plugin-create', function() {
 		const done = this.async();
 		const options = getOptions( this );
-		pluginCreateTask( ckeditor5Path, options, grunt.log.writeln, grunt.log.error ).then( done );
+		pluginCreateTask( ckeditor5Path, options, grunt.log.writeln, grunt.log.error )
+			.then( done )
+			.catch( ( error )  => done( error ) );
 	} );
 
 	grunt.registerTask( 'dev-plugin-install', function() {
 		const done = this.async();
 		const options = getOptions( this );
-		pluginInstallTask( ckeditor5Path, options, grunt.log.writeln, grunt.log.error ).then( done );
+		pluginInstallTask( ckeditor5Path, options, grunt.log.writeln, grunt.log.error )
+			.then( done )
+			.catch( ( error )  => done( error ) );
 	} );
 
 	grunt.registerTask( 'dev-update', function() {