pnxtech / hydra

A light-weight library for building distributed applications such as microservices
https://www.hydramicroservice.com
MIT License
645 stars 54 forks source link

_sendMessage should use _reject() #175

Closed sjmcdowall closed 6 years ago

sjmcdowall commented 6 years ago

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

cjus commented 6 years ago

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

sjmcdowall commented 6 years ago

This was fixed in PR#182 ...