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

fix logging: in search "error" can be legitimate output (package named "error"), not an actual error

ref #65
This commit is contained in:
Alex Kocharin 2014-06-22 18:06:16 +04:00
parent 9816059485
commit 3f746eb7c8
2 changed files with 2 additions and 2 deletions

View file

@ -134,7 +134,7 @@ module.exports.log_and_etagify = function(req, res, next) {
res.header('Content-type', 'application/json')
if (typeof(body) === 'object' && body != null) {
if (body.error) {
if (typeof(body.error) === 'string') {
res._sinopia_error = body.error
}
body = JSON.stringify(body, undefined, '\t') + '\n'

View file

@ -174,7 +174,7 @@ Storage.prototype.request = function(options, cb) {
}
if (!err && utils.is_object(body)) {
if (body.error) {
if (typeof(body.error) === 'string') {
error = body.error
}
}