Closed AnneKlapwijk closed 7 years ago
This works, but do you think you could update this so that reject(e)
remains and we use console.log(e.message)
in the .then()
handler instead? I think that would be even more consistent with the other tasks, plus it’s quite uncommon that the value passed to reject()
is not an error object.
Thanks. I’ve published promise-it-wont-hurt@1.1.0
– this was long overdue and contains quite a few updates. Let us know if you run into any trouble!
@addaleax Thanks! Will do.
What has been done
A very simple fix for https://github.com/stevekane/promise-it-wont-hurt/issues/126 and https://github.com/stevekane/promise-it-wont-hurt/issues/102
Instead of comparing the console logs of the error objects (which contain different file paths), compare the error messages.
Besides fixing the error, this would also make the exercise more consistent with exercise 3 "reject_a_promise" and 6 "shortcuts" which also console.log
error.message
instead of the entireerror
object.How to test
npm install -g promise-it-wont-hurt@latest
promise-it-wont-hurt select throw_an_error
solution.js
which contains something like this:parsePromised(process.argv[2]) .then(null, console.log)