Fix wrong handling of error messages vertx-eventbus.js
this.onunhandled = function (json) {
try {
- if (json.event) {
+ if (json.type === 'err')
+ self.onerror(json);
+ else if (json.event) {
console.warn('No handler found for event: %o. Message: %O', json.event, json);
} else {
console.warn('No handler found for message: ', json);
};
}
- if (json.type === 'err') {
- self.onerror(json);
- return;
- }
-
// define a reply function on the message itself
if (json.replyAddress) {
Object.defineProperty(json, 'reply', {
