Jelajahi Sumber

@uppy/url: remove unused error handler (#5200)

Mikael Finstad 11 bulan lalu
induk
melakukan
26cdd6b370
1 mengubah file dengan 1 tambahan dan 9 penghapusan
  1. 1 9
      packages/@uppy/url/src/Url.tsx

+ 1 - 9
packages/@uppy/url/src/Url.tsx

@@ -121,15 +121,7 @@ export default class Url<M extends Meta, B extends Body> extends UIPlugin<
   }
   }
 
 
   private getMeta = (url: string): Promise<MetaResponse> => {
   private getMeta = (url: string): Promise<MetaResponse> => {
-    return this.client.post<MetaResponse>('url/meta', { url }).then((res) => {
-      // TODO: remove this handler in the next major
-      if ((res as any).error) {
-        this.uppy.log('[URL] Error:')
-        this.uppy.log((res as any).error)
-        throw new Error('Failed to fetch the file')
-      }
-      return res
-    })
+    return this.client.post<MetaResponse>('url/meta', { url })
   }
   }
 
 
   private addFile = async (
   private addFile = async (