pnxtech / hydra

A light-weight library for building distributed applications such as microservices

Home Page:https://www.hydramicroservice.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

_sendMessage should use _reject()

sjmcdowall opened this issue · comments

https://github.com/flywheelsports/hydra/blob/master/index.js#L1364

According to the "specs" for the function, on error(s) the method should call a reject .. but in all instances it actually invokes resolve() with an error message. Besides breaking the contract -- it probably should throw a reject() on errors.

Suspicious lines:

https://github.com/flywheelsports/hydra/blob/master/index.js#L1382

https://github.com/flywheelsports/hydra/blob/master/index.js#L1396

@sjmcdowall the code does what we want. However, the JSDOC should be updated to reflect the usage.

This was fixed in PR#182 ...