Revert "Make 404 responses compatible with CouchDB API"

This reverts commit dabf5e1c9a.

See discussion in #57
This commit is contained in:
Alex Kocharin 2014-03-29 01:08:28 +00:00
parent 7967d5857d
commit 4b06026d2e
1 changed files with 1 additions and 9 deletions

View File

@ -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}')