FlandreDaisuki/dmhy-subscribe

下載器啟動失敗卻顯示下載成功

Closed this issue · 4 comments

  • OS: 大概是 Linux
  • NodeJS: ?
  • CLI version: 0.6.4
  • Error message 錯誤訊息:
    photo_2018-04-10_12-47-12
    當 downloader 為 system 且系統找不到 magnet 的關聯程式時會出現此錯誤

https://github.com/FlandreDaisuki/dmhy-subscribe/blob/master/src/downloaders/system.js#L12

感覺無解... 被 exit(4) 之後,Promise 好像也是走 resolve

catch 拿掉,或是在 catch 裡面再 throw 一次
其他的下載器也應該這樣做才對,之前沒注意到= =

Inndy commented

@FlandreDaisuki process 跑不起來才是 error,process 跑起來了,檢查 exit code 非 0 吧

@maple3142
是因為我們之前用 spawn 現在用 require 的關係嘛?

dmhy-subscribe/src/utils.js

Lines 263 to 266 in 4e85966

function downloadThreadWithDownloader(downloader, thread, config) {
const dl = require(`${__dirname}/downloaders/${downloader}`);
return dl(thread, config);
}

但這樣可能就變成四個 downloader 都用檢查 exit 的值來判斷成功失敗?
或這就這個繼續 system.js 繼續 throw Error