Browse Source

Revert "core: Do not rethrow restriction failures."

This reverts commit b419ad1006cd32a980b3dbf28048e8c6c3ecdc8d.
Renée Kooi 7 years ago
parent
commit
2c2b4c7894
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/core/Core.js

+ 2 - 2
src/core/Core.js

@@ -341,8 +341,9 @@ class Uppy {
 
     const onError = (msg) => {
       const err = typeof msg === 'object' ? msg : new Error(msg)
-      this.log(err, 'warning')
+      this.log(err.message)
       this.info(err.message, 'error', 5000)
+      throw err
     }
 
     let mappedFile
@@ -350,7 +351,6 @@ class Uppy {
       mappedFile = this.opts.onBeforeFileAdded(file, files)
     } catch (err) {
       onError(err)
-      return
     }
 
     if (typeof mappedFile === 'object' && mappedFile) {