Closed gideonairex closed 8 years ago
i agree the current set up is bad. i think the cb(err, reply.body)
version would be better to do. i tried to make this change quite a while ago, but didn't have time and forgot about it.
this would be breaking change for the API of rabbus, but i think it would be a good change to make.
I can have a PR for this.
FWIW, I've just released v0.7.0 of Rabbus which includes a complete rewrite of the middleware and error handling processes.
Now, error are handled as middleware and include the message, properties and actions you can perform on the message:
For example:
someReceiver.use(function(err, message, props, actions, next){
console.log(err.stack);
actions.reject();
next();
});
Be sure to check out the UPGRADING.md doc for more information on the changes
Hi Is there a way that this could be a callback or make them both promise objects?https://github.com/derickbailey/rabbus/blob/master/rabbus/lib/req-res/requester.js#L48-L50 The problem is that if Im going to use this as request and when there is an error its difficult to handle the error.
or wrapped it with promise so that we can chain the result.