electron-dl 库的download方法在断网情况下,promise不会reject Posted on 2023-10-13 Edited on 2023-10-27 这个问题是他们库的实现上缺少功能,目前只能自己再包一层promise,手动监听一下 downloadItem的updated事件,如果state是injected,就reject 12345item.on('updated', (event, state) => { if (state === 'interrupted') { reject(new Error('download failed')) }})