Comparing version 2.1.5 to 2.1.6
@@ -24,2 +24,13 @@ const path = require('path'); | ||
if (cfg.webhook) { | ||
let cb = callback; | ||
callback = (err, result, headers) => { | ||
let prefix = `-> Simulated Webhook [${names.join('.')}]${err ? ' ERROR' : ''}: `; | ||
let presult = typeof result === 'object' ? JSON.stringify(result, null, 2) : (result + ''); | ||
let message = (err ? (err.stack || err.message) : presult).split('\n').map(v => `${prefix}${v}`).join('\n'); | ||
console.log(message); | ||
cb(err, 'webhook ok', headers); | ||
}; | ||
} | ||
try { | ||
@@ -30,2 +41,3 @@ fn = require(pathname); | ||
} catch (e) { | ||
cfg.webhook || console.error(e); | ||
return callback(e); | ||
@@ -32,0 +44,0 @@ } |
{ | ||
"name": "lib", | ||
"version": "2.1.5", | ||
"version": "2.1.6", | ||
"description": "StdLib: Standard Library for Microservices Node.js Bindings", | ||
@@ -5,0 +5,0 @@ "main": "lib.js", |
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
13795
241