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

harcon-amqp

Package Overview
Dependencies
Maintainers
1
Versions
197
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

harcon-amqp - npm Package Compare versions

Comparing version 9.1.1 to 9.1.2

26

lib/AmqpBarrel.js

@@ -16,2 +16,21 @@ let _ = require('isa.js')

let errorAttribs = [ 'code', 'message', 'errorCode', 'id', 'reason' ]
function printError (err) {
let res = {}
for (let attrib of errorAttribs)
if ( err[ attrib ] )
res[ attrib ] = err[attrib]
res.message = err.message || err.toString()
return res
}
function buildError (obj) {
let error = new Error('')
for (let attrib of errorAttribs)
if ( obj[ attrib ] )
error[ attrib ] = obj[attrib]
return error
}
amqpbarrel.randomNodeID = function ( valve, division, entityName ) {

@@ -243,3 +262,3 @@ if ( _.isNumber( valve ) ) return valve

let responses = comm.responseComms.map(function (c) { return Communication.importCommunication( c ) })
await self.appease( realComm, comm.err ? new Error(comm.err) : null, responses )
await self.appease( realComm, comm.err ? buildError(comm.err) : null, responses )
}

@@ -281,6 +300,7 @@ return 'ok'

self.logger.harconlog( null, 'Packet sending', {comm: comm, err: err ? err.message || err.toString() : null, responseComms: responseComms}, 'trace' )
let error = err ? printError(err) : null
self.logger.harconlog( null, 'Packet sending', {comm: comm, err: error, responseComms: responseComms}, 'trace' )
let entityName = comm.source // event.substring(0, comm.event.indexOf('.') )
let packet = JSON.stringify( { id: comm.id, comm: comm, err: err ? err.message || err.toString() : null, response: true, responseComms: responseComms || [] } )
let packet = JSON.stringify( { id: comm.id, comm: comm, err: error, response: true, responseComms: responseComms || [] } )
let nodeNO = comm.sourceNodeID || self.randomNodeID( comm.valve, comm.sourceDivision, entityName )

@@ -287,0 +307,0 @@ self.outs[ comm.sourceDivision ].publish( entityName + (nodeNO ? (SEPARATOR + nodeNO) : ''), packet, 'utf8')

2

package.json
{
"name": "harcon-amqp",
"version": "9.1.1",
"version": "9.1.2",
"description": "AMQP plugin for the harcon messaging/service bus of node-based enterprise entities.",

@@ -5,0 +5,0 @@ "keywords": [

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