diff --git a/lib/index.js b/lib/index.js index 7a7ebec..21a3ceb 100644 --- a/lib/index.js +++ b/lib/index.js @@ -79,6 +79,11 @@ module.exports.coerceError = function (error) { function logger(level) { return function (code, reasons, meta) { + if (code instanceof CuvvaError) { + handleError(level, code); + return code; + } + var error = new CuvvaError(code, reasons, meta); handleError(level, error); return error; diff --git a/package.json b/package.json index 3b55527..62a3873 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cuvva-log", - "version": "0.5.0", + "version": "0.5.1", "description": "Super simple standardized logging used by all Cuvva systems", "homepage": "https://github.com/cuvva/cuvva-log-node", "bugs": "https://github.com/cuvva/cuvva-log-node/issues",