Browse Source

log error from StatusBar and Form plugin

Artur Paikin 7 năm trước cách đây
mục cha
commit
0c0c93d183

+ 3 - 1
src/plugins/Form.js

@@ -53,7 +53,9 @@ module.exports = class Form extends Plugin {
   handleFormSubmit (ev) {
   handleFormSubmit (ev) {
     if (this.opts.triggerUploadOnSubmit) {
     if (this.opts.triggerUploadOnSubmit) {
       ev.preventDefault()
       ev.preventDefault()
-      this.uppy.upload()
+      this.uppy.upload().catch((err) => {
+        this.uppy.log(err.stack || err.message || err)
+      })
     }
     }
   }
   }
 
 

+ 2 - 1
src/plugins/StatusBar/index.js

@@ -94,7 +94,8 @@ module.exports = class StatusBar extends Plugin {
   }
   }
 
 
   startUpload () {
   startUpload () {
-    return this.uppy.upload().catch(() => {
+    return this.uppy.upload().catch((err) => {
+      this.uppy.log(err.stack || err.message || err)
       // Ignore
       // Ignore
     })
     })
   }
   }