Add some more error handling and logging to the image upload#2176
Add some more error handling and logging to the image upload#2176MisRob merged 1 commit intolearningequality:developfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #2176 +/- ##
========================================
Coverage 80.64% 80.64%
========================================
Files 288 288
Lines 14035 14035
========================================
Hits 11318 11318
Misses 2717 2717 Continue to review full report at Codecov.
|
| @@ -159,6 +159,19 @@ | |||
| this.initImageFields(); | |||
| } | |||
| }, | |||
There was a problem hiding this comment.
Those two new watchers are related to a situation when a new file is dropped to the editor area (when uploading an image using the image upload menu, progress and errors will be displayed - I haven't checked yet but can see that implementation is there)
| 'file.progress'(progress) { | ||
| if (progress === 0) { | ||
| // eslint-disable-next-line | ||
| console.log('The image upload has started'); |
There was a problem hiding this comment.
Probably good to remove this later, but makes sense to have it in the short term. Ideally, there would be a progress bar somewhere to show uploading in progress
| }, | ||
| 'file.error'() { | ||
| // eslint-disable-next-line | ||
| console.error('The image could not be uploaded'); |
There was a problem hiding this comment.
This should probably be a snackbar instead of a console error. Something like "Upload failed. Please try again."
|
Thanks Jordan, yes it's just temporary to have something before we address the follow-up issue #2177. I will link those lines to that issue to be sure that it'll be removed as soon as we have the implementation. |
Description
I've discovered several places where some more information would be useful for debugging purposes while documenting image uploading. I assume that we'll implement some UX to display errors and upload progress but for now I added at least some logging. I am going to open follow-up issues and link them here soon.