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:
parent
3ca3ac2dae
commit
fa51797602
1 changed files with 8 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue