Don't bother checking for error properties on error object

This commit is contained in:
Shane Kilkelly 2017-03-21 14:19:12 +00:00
parent f2ebdd1662
commit 7bdba3756b

View file

@ -22,7 +22,7 @@ module.exports = (obj, methodName, prefix, logger) ->
realMethod.call this, firstArgs..., (callbackArgs...) ->
elapsedTime = timer.done()
possibleError = callbackArgs[0]
if possibleError? && possibleError.message? && possibleError.stack?
if possibleError?
metrics.inc "#{key}.failure"
else
metrics.inc "#{key}.success"