Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Merge branch t/ckeditor5-watchdog/1
Browse files Browse the repository at this point in the history
Internal: Add context to CKEditorError exceptions. Required by ckeditor/ckeditor5-watchdog#2.
  • Loading branch information
Piotr Jasiun committed Jul 2, 2019
2 parents 938f0f7 + ff09837 commit 571e8bd
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/filerepository.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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';
Expand Down

0 comments on commit 571e8bd

Please sign in to comment.