0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-12-16 21:56:25 -05:00

return 500 instead of 404 if local storage is corrupted

This commit is contained in:
Alex Kocharin 2013-10-19 01:35:41 +04:00
parent 3ca3ac2dae
commit fa51797602

View file

@ -331,7 +331,14 @@ Storage.prototype.get_package = function(name, callback) {
async.map(uplinks, function(up, cb) {
up.get_package(name, function(err, up_res) {
if (err) return cb();
if (err) {
if (up === self.local && (!err.status || err.status >= 500)) {
// report internal errors right away
return cb(err)
} else {
return cb()
}
}
if (up === self.local) {
// file exists in local repo