Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

help-esb

Package Overview
Dependencies
Maintainers
4
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

help-esb - npm Package Compare versions

Comparing version 0.6.5 to 0.6.6

55

help-esb.js

@@ -53,2 +53,8 @@ (function(root, factory) {

// });
//
// Supported options:
// * `debug`: This logs messages to the console.
// * `newrelic`: This option can be set as an instance of the newrelic agent.
// RPC requests received by this client will be wrapped in a newrelic
// transaction named after the group.
HelpEsb.Client = function(uri, options) {

@@ -64,3 +70,3 @@ // Extend EventEmitter to handle events.

this._login = null;
this._options = _.extend({debug: false}, options);
this._options = _.extend({debug: false, newrelic: null}, options);

@@ -178,4 +184,5 @@ this.mb = new HelpEsb.MessageBuilder(this);

HelpEsb.Client.prototype.rpcReceive = function(group, cb) {
var newrelic = this._options.newrelic;
this.subscribe(group);
this.on('group.' + group, function(message) {
var messageHandler = function(message) {
var meta = {

@@ -208,3 +215,3 @@ type: 'sendMessage',

Promise.try(cb.bind({}, message)).then(function(message) {
var execute = Promise.try(cb.bind({}, message)).then(function(message) {
return sendToAll(

@@ -215,9 +222,43 @@ this.mb.success(

);
}.bind(this)).catch(function(error) {
var reason = error instanceof Error ? error.toString() : error;
}.bind(this));
var errorHandler = function(error) {
var reason = _.isError(error) ? error.toString() : error;
var errorMeta = _.extend({reason: reason}, meta);
if (newrelic !== null) {
newrelic.noticeError(
_.isError(error) ? error : ('' + error),
message.toJSON()
);
}
return sendToAll(this.mb.failure({meta: errorMeta}));
}.bind(this));
}.bind(this));
}.bind(this);
if (newrelic !== null) {
errorHandler = newrelic.agent.tracer.bindFunction(
errorHandler,
newrelic.agent.tracer.segment
);
}
execute = execute.catch(errorHandler);
if (newrelic !== null) {
execute.finally(newrelic.agent.tracer.bindFunction(
newrelic.endTransaction.bind(newrelic),
newrelic.agent.tracer.segment
));
}
}.bind(this);
if (newrelic !== null) {
messageHandler = newrelic.createBackgroundTransaction(
group,
messageHandler
);
}
this.on('group.' + group, messageHandler);
};

@@ -224,0 +265,0 @@

2

package.json
{
"name": "help-esb",
"version": "0.6.5",
"version": "0.6.6",
"description": "A client for the Help.com team's ESB.",

@@ -5,0 +5,0 @@ "main": "help-esb.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc