8
0
Pārlūkot izejas kodu

Added error contexts.

Maciej Bukowski 6 gadi atpakaļ
vecāks
revīzija
16bfd85242
1 mainītis faili ar 5 papildinājumiem un 2 dzēšanām
  1. 5 2
      packages/ckeditor5-upload/src/filerepository.js

+ 5 - 2
packages/ckeditor5-upload/src/filerepository.js

@@ -420,7 +420,7 @@ class FileLoader {
 	 */
 	read() {
 		if ( this.status != 'idle' ) {
-			throw new CKEditorError( 'filerepository-read-wrong-status: You cannot call read if the status is different than idle.' );
+			throw new CKEditorError( 'filerepository-read-wrong-status: You cannot call read if the status is different than idle.', this );
 		}
 
 		this.status = 'reading';
@@ -465,7 +465,10 @@ class FileLoader {
 	 */
 	upload() {
 		if ( this.status != 'idle' ) {
-			throw new CKEditorError( 'filerepository-upload-wrong-status: You cannot call upload if the status is different than idle.' );
+			throw new CKEditorError(
+				'filerepository-upload-wrong-status: You cannot call upload if the status is different than idle.',
+				this
+			);
 		}
 
 		this.status = 'uploading';