Quellcode durchsuchen

remove unnessesary try/catch

Artur Paikin vor 6 Jahren
Ursprung
Commit
3a0a43ec2e
2 geänderte Dateien mit 3 neuen und 11 gelöschten Zeilen
  1. 1 1
      src/core/Core.js
  2. 2 10
      src/plugins/Url/index.js

+ 1 - 1
src/core/Core.js

@@ -448,7 +448,7 @@ class Uppy {
       this.scheduledAutoProceed = setTimeout(() => {
         this.scheduledAutoProceed = null
         this.upload().catch((err) => {
-          onError(err.stack || err.message || err)
+          console.error(err.stack || err.message || err)
         })
       }, 4)
     }

+ 2 - 10
src/plugins/Url/index.js

@@ -162,11 +162,7 @@ module.exports = class Url extends Plugin {
         if (item.kind === 'string' && item.type === 'text/uri-list') {
           item.getAsString((url) => {
             this.uppy.log(`[URL] Adding file from dropped url: ${url}`)
-            try {
-              this.addFile(url)
-            } catch (err) {
-              // Nothing, restriction errors handled in Core
-            }
+            this.addFile(url)
           })
         }
       })
@@ -197,11 +193,7 @@ module.exports = class Url extends Plugin {
         if (item.kind === 'string' && item.type === 'text/plain') {
           item.getAsString((url) => {
             this.uppy.log(`[URL] Adding file from pasted url: ${url}`)
-            try {
-              this.addFile(url)
-            } catch (err) {
-              // Nothing, restriction errors handled in Core
-            }
+            this.addFile(url)
           })
         }
       })