diff --git a/src/core/Core.js b/src/core/Core.js index 9dd8312693..b46d5e252b 100644 --- a/src/core/Core.js +++ b/src/core/Core.js @@ -230,7 +230,10 @@ class Uppy { } addFile (file) { - return this.opts.onBeforeFileAdded(file, this.getState().files).then(() => { + return this.opts.onBeforeFileAdded(file, this.getState().files).catch((err) => { + this.emit('informer', err, 'error', 5000) + return Promise.reject(`onBeforeFileAdded: ${err}`) + }).then(() => { return Utils.getFileType(file).then((fileType) => { const updatedFiles = Object.assign({}, this.state.files) const fileName = file.name || 'noname' @@ -288,10 +291,6 @@ class Uppy { } }) }) - .catch((err) => { - this.emit('informer', err, 'error', 5000) - return Promise.reject(`onBeforeFileAdded: ${err}`) - }) } removeFile (fileID) {