Closed jamen closed 8 years ago
I kept latest-version
at 1.0.1 to be compatible with node 0.10.0
Latest latest-version
is compatible with Node.js 0.10: https://github.com/sindresorhus/latest-version/blob/244ac1b8d601bcfa8a38de47610a6ad8f2898712/.travis.yml#L7
Still need to remove https://github.com/yeoman/doctor/pull/28/files#r52161931
You just wanted me to let it throw the error, if the package cant be accessed, instead of handling it like that? I forgot when, but I looked in the source of your packages, and I think it just originated back to package-json
, which just throws a "package not found"
error, or whatever error comes from got
. I thought maybe I should handle it.
@jamen I think it's better to let unexpected error unhandled so someone is notified when something fails.
You just wanted me to let it throw the error, if the package cant be accessed, instead of handling it like that? I forgot when, but I looked in the source of your packages, and I think it just originated back to package-json, which just throws a "package not found" error, or whatever error comes from got.
Then the error message should be improved there so every consumer benefits, not here.
Alright, makes sense... But, since latest-version
is Promise
-based, should I throw the error?
.catch(function(err) {
throw err;
})
Otherwise, it would probably just exit without any trace of an error happening.
I suppose that doesn't work, actually... console.log
+ process.exit
?
throw
is fine as it'll be uncaught and fail the process. You should never ever use process.exit()
I'll have to use something hackish, because the promise will actually catch it again:
.catch(function(err) {
throw err;
}).catch(function(err) {
// Same error... Never uncaught in the process
})
Something like:
.catch(function(err) {
setTimeout(function() {
throw err;
});
})
You could also use console.error(err)
. It'll print to stderr, so that might be good enough.
@SBoudrias: Changed it to console.error(err)
(as well as call cb(err)
), added tests for the new rule, fixed some travis difficulties, and squashed commits.
@jamen hey, any chance we can wrap this up?
Sure thing, I will try to get your suggestions done today (tonight for me, possibly).
@SBoudrias Pretty sure it is failing to build because of stuff not related to mine now.
Yeah the tests are failing due to changes inside the linter. No need to address them now.
Thanks for the PR by the way! Keep em coming ;)
Your welcome, and will do.
Some releases (like patches) include fixes to bugs. Its helpful for the user to see that they are running an out-of-date version of yo, if they are.