node-code-error
Advanced tools
Comparing version 0.1.3 to 0.1.31
@@ -26,3 +26,3 @@ 'use strict' | ||
function Ctor (msg, code, orignalError) { | ||
if (Errors._useMsgCode) { | ||
if (Errors._useMsgCode && !util.isNumberLike(code)) { | ||
orignalError = code | ||
@@ -54,4 +54,4 @@ code = Errors.ensureCode(msg) | ||
arr.forEach(function (item, ind) { | ||
var codePart = maps[ind][item] || 0 | ||
code += codePart | ||
var codePart = maps[ind][item] | ||
if (codePart !== undefined) code += codePart | ||
}) | ||
@@ -58,0 +58,0 @@ return +code |
{ | ||
"name": "node-code-error", | ||
"version": "0.1.3", | ||
"version": "0.1.31", | ||
"description": "define node error with code", | ||
@@ -5,0 +5,0 @@ "main": "./index.js", |
@@ -7,9 +7,2 @@ 'use strict' | ||
// Errors.extend('system', 500, 100, 0) | ||
// Errors.extend('internal', 500, 101, 0) | ||
// Errors.extend('param', 400, 103, 0) | ||
// Errors.extend('api', 400, 104) | ||
// Errors.extend('jwt', 400, 105) | ||
// Errors.extend('oauth2', 400, 106) | ||
it('extend', function () { | ||
@@ -16,0 +9,0 @@ Errors.extend('internal', 500, 101, 0) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9450
199