diff --git a/src/core/Core.js b/src/core/Core.js index 537ac9a38..6027f1bee 100644 --- a/src/core/Core.js +++ b/src/core/Core.js @@ -389,13 +389,7 @@ class Uppy { .catch((err) => { const message = typeof err === 'object' ? err.message : err this.info(message, 'error', 5000) - const rejected = Promise.reject(typeof err === 'object' ? err : new Error(err)) - // Silence the unhandled rejection; we have already shown it to the user, - // so the consumer may not need to do anything with this result. - // Note that the result is still a rejected Promise, it will just not - // trigger unhandled rejection warnings in the browser console. - rejected.catch(() => {}) - return rejected + return Promise.reject(typeof err === 'object' ? err : new Error(err)) }) } diff --git a/src/plugins/Dashboard/index.js b/src/plugins/Dashboard/index.js index 760dce592..c4b84ae5f 100644 --- a/src/plugins/Dashboard/index.js +++ b/src/plugins/Dashboard/index.js @@ -277,6 +277,8 @@ module.exports = class Dashboard extends Plugin { name: file.name, type: file.type, data: blob + }).catch(() => { + // Ignore }) }) } @@ -291,6 +293,8 @@ module.exports = class Dashboard extends Plugin { name: file.name, type: file.type, data: file + }).catch(() => { + // Ignore }) }) } @@ -360,6 +364,8 @@ module.exports = class Dashboard extends Plugin { name: file.name, type: file.type, data: file + }).catch(() => { + // Ignore }) }) } diff --git a/src/plugins/DragDrop/index.js b/src/plugins/DragDrop/index.js index 8b6825e86..d74e97596 100644 --- a/src/plugins/DragDrop/index.js +++ b/src/plugins/DragDrop/index.js @@ -83,6 +83,8 @@ module.exports = class DragDrop extends Plugin { name: file.name, type: file.type, data: file + }).catch(() => { + // Ignore }) }) } @@ -98,6 +100,8 @@ module.exports = class DragDrop extends Plugin { name: file.name, type: file.type, data: file + }).catch(() => { + // Ignore }) }) } diff --git a/src/plugins/Dummy.js b/src/plugins/Dummy.js index 3a1e108fe..bd0d9bbc6 100644 --- a/src/plugins/Dummy.js +++ b/src/plugins/Dummy.js @@ -35,7 +35,9 @@ module.exports = class Dummy extends Plugin { data: blob } this.props.log('Adding fake file blob') - this.props.addFile(file) + this.props.addFile(file).catch(() => { + // Ignore + }) } render (state) { diff --git a/src/plugins/FileInput.js b/src/plugins/FileInput.js index 606cc9846..2ac5eaee3 100644 --- a/src/plugins/FileInput.js +++ b/src/plugins/FileInput.js @@ -51,6 +51,8 @@ module.exports = class FileInput extends Plugin { name: file.name, type: file.type, data: file + }).catch(() => { + // Ignore }) }) } diff --git a/src/plugins/Provider/view/index.js b/src/plugins/Provider/view/index.js index c99c728d4..92117558c 100644 --- a/src/plugins/Provider/view/index.js +++ b/src/plugins/Provider/view/index.js @@ -169,7 +169,9 @@ module.exports = class View { tagFile.preview = this.plugin.getItemThumbnailUrl(file) } this.plugin.uppy.log('Adding remote file') - this.plugin.uppy.addFile(tagFile) + this.plugin.uppy.addFile(tagFile).catch(() => { + // Ignore + }) if (!isCheckbox) { this.donePicking() } diff --git a/src/plugins/Webcam/index.js b/src/plugins/Webcam/index.js index 264223443..e7286b296 100644 --- a/src/plugins/Webcam/index.js +++ b/src/plugins/Webcam/index.js @@ -169,7 +169,7 @@ module.exports = class Webcam extends Plugin { }) return this.getVideo() }) - .then(this.uppy.addFile) + .then((file) => this.uppy.addFile(file)) .then(() => { this.recordingChunks = null this.recorder = null @@ -233,9 +233,11 @@ module.exports = class Webcam extends Plugin { return this.getImage() }).then((tagFile) => { this.captureInProgress = false - this.uppy.addFile(tagFile) const dashboard = this.uppy.getPlugin('Dashboard') if (dashboard) dashboard.hideAllPanels() + return this.uppy.addFile(tagFile).catch(() => { + // Ignore + }) }, (error) => { this.captureInProgress = false throw error