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:
parent
9816059485
commit
3f746eb7c8
2 changed files with 2 additions and 2 deletions
|
@ -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'
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue