Skip to content

Commit

Permalink
Revert "Don't support logging existing 'CuvvaError' objects"
Browse files Browse the repository at this point in the history
This reverts commit d120893.

Conflicts:
	lib/index.js

Useful for logging coerced errors
  • Loading branch information
billinghamj committed Aug 26, 2015
1 parent a28af46 commit 801938d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit 801938d

Please sign in to comment.