mirror of
https://github.com/verdaccio/verdaccio.git
synced 2024-11-08 23:25:51 +01:00
Revert "Make 404 responses compatible with CouchDB API"
This reverts commit dabf5e1c9a7e53f435b89d9e0fbf8e091e7e40e8. See discussion in #57
This commit is contained in:
parent
7967d5857d
commit
4b06026d2e
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 (err.status && err.status >= 400 && err.status < 600) {
|
||||||
if (calls == 1) {
|
if (calls == 1) {
|
||||||
res.status(err.status)
|
res.status(err.status)
|
||||||
var body = {error: err.msg || err.message || 'unknown error'};
|
res.send({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)
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Logger.logger.error({err: err}, 'unexpected error: @{!err.message}\n@{err.stack}')
|
Logger.logger.error({err: err}, 'unexpected error: @{!err.message}\n@{err.stack}')
|
||||||
|
Loading…
Reference in New Issue
Block a user