mirror of
https://github.com/verdaccio/verdaccio.git
synced 2025-01-06 22:40:26 -05:00
Revert "Make 404 responses compatible with CouchDB API"
This reverts commit dabf5e1c9a
.
See discussion in #57
This commit is contained in:
parent
7967d5857d
commit
4b06026d2e
1 changed files with 1 additions and 9 deletions
10
lib/index.js
10
lib/index.js
|
@ -64,15 +64,7 @@ module.exports = function(config_hash) {
|
|||
if (err.status && err.status >= 400 && err.status < 600) {
|
||||
if (calls == 1) {
|
||||
res.status(err.status)
|
||||
var body = {error: err.msg || err.message || 'unknown error'};
|
||||
|
||||
// Make 404 responses compliant with CouchDB REST API
|
||||
if (err.status == 404) {
|
||||
body.reason = body.error
|
||||
body.error = 'not_found'
|
||||
}
|
||||
|
||||
res.send(body)
|
||||
res.send({error: err.msg || err.message || 'unknown error'})
|
||||
}
|
||||
} else {
|
||||
Logger.logger.error({err: err}, 'unexpected error: @{!err.message}\n@{err.stack}')
|
||||
|
|
Loading…
Reference in a new issue