snobu / destreamer

Save Microsoft Stream videos for offline enjoyment.
MIT License
2.36k stars 440 forks source link

Error object not deserialized before verbose logging #271

Closed lukaarma closed 3 years ago

lukaarma commented 3 years ago
[WARNING] Got HTTP code 403. Retrying request...

[VERBOSE] Here is the error message:
 '[object Object]

[ERROR] Error: Request failed with status code 403
    at createError (C:\Users\sami\Desktop\1\node_modules\axios\lib\core\createEr
ror.js:16:15)
    at settle (C:\Users\sami\Desktop\1\node_modules\axios\lib\core\settle.js:17:
12)
    at IncomingMessage.handleStreamEnd (C:\Users\sami\Desktop\1\node_modules\axi
os\lib\adapters\http.js:236:11)
    at IncomingMessage.emit (events.js:326:22)
    at endReadableNT (_stream_readable.js:1223:12)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)

When printing the error in the ApiClient with verbose logging we are missing a JSON.stringify() so we print [object Object]

snobu commented 3 years ago

Fixed in both master and aria development branches, thanks for the report! We should probably print the response body without the verbose flag as well since, well.. it's a critical piece of information we should return to the user.