Browse Source

core: Do not rethrow restriction failures.

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

+ 2 - 2
src/core/Core.js

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