Browse Source

log error from StatusBar and Form plugin

Artur Paikin 7 years ago
parent
commit
0c0c93d183
2 changed files with 5 additions and 2 deletions
  1. 3 1
      src/plugins/Form.js
  2. 2 1
      src/plugins/StatusBar/index.js

+ 3 - 1
src/plugins/Form.js

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