Explorar el Código

fix:优化try写法改为Promise写法

Jerry Liang hace 9 meses
padre
commit
add1561019
Se han modificado 1 ficheros con 1 adiciones y 3 borrados
  1. 1 3
      src/service/fetchClient.ts

+ 1 - 3
src/service/fetchClient.ts

@@ -259,9 +259,7 @@ export class FetchClient {
       try {
         controller.abort() // 中断 fetch readable
       } catch {}
-      try {
-        writable.abort() // 中断写入
-      } catch {}
+      writable.abort().catch(() => {}) // 中断写入
 
       window.removeEventListener('beforeunload', stopDownload)
     }