Comparing version 3.5.5 to 3.5.6
@@ -129,3 +129,3 @@ (function(self) { | ||
if (e && e.stack && typeof $global.$logError === 'function') | ||
$global.$logError(e); | ||
$global.$logError(e, fullref); | ||
throw e; | ||
@@ -132,0 +132,0 @@ }); |
{ | ||
"name": "clues", | ||
"version": "3.5.5", | ||
"version": "3.5.6", | ||
"description": "Lightweight logic tree solver using promises.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -148,3 +148,3 @@ [![NPM Version][npm-image]][npm-url] | ||
You can provide a function called `$logError` in the `$global` object to record any true javascript errors (with `.stack`) when they occur. For proper logging it is important to capture the error at source, as the dependencies might be optional - in which case the error never reaches the original request. | ||
You can provide a function called `$logError` in the `$global` object to record any true javascript errors (with `.stack`) when they occur. The `$logError` function will be called with the error object as first argument and `fullref` as the second argument. For proper logging it is important to capture the error at source, as the dependencies might be optional - in which case the error never reaches the original request. | ||
@@ -151,0 +151,0 @@ ### making arguments optional with the underscore prefix |
@@ -111,7 +111,8 @@ var clues = require('../clues'), | ||
it('should log an error with stack',function() { | ||
var facts = Object.create(logic),error; | ||
return clues(facts,'stack_error',{$logError:function(e) {error = e;}}) | ||
var facts = Object.create(logic),error,fullref; | ||
return clues(facts,'stack_error',{$logError:function(e,f) {error = e;fullref = f;}}) | ||
.catch(Object) | ||
.then(function() { | ||
assert.equal(error && error.message,'error'); | ||
assert.equal(fullref,'stack_error'); | ||
}); | ||
@@ -121,7 +122,8 @@ }); | ||
it('should log a rejected promise with stack',function() { | ||
var facts = Object.create(logic),error; | ||
return clues(facts,'stack_error_promise',{$logError:function(e) {error = e;}}) | ||
var facts = Object.create(logic),error,fullref; | ||
return clues(facts,'stack_error_promise',{$logError:function(e,f) {error = e; fullref = f;}}) | ||
.catch(Object) | ||
.then(function() { | ||
assert.equal(error && error.message,'error'); | ||
assert.equal(fullref,'stack_error_promise'); | ||
}); | ||
@@ -128,0 +130,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
83616
1591