bennidi / mbassador

Powerful event-bus optimized for high throughput in multi-threaded applications. Features: Sync and Async event publication, weak/strong references, event filtering, annotation driven
MIT License
958 stars 146 forks source link

Exception pass through #119

Closed StephanEmmerich closed 9 years ago

StephanEmmerich commented 9 years ago

In our scenario we use (synchronous) change events on entities to validate if certain changes are allowed (not unlike vetoable property change events on java beans). When this is not the case, a ValidateException is thrown. This event should be taken care of by the code attempting the change. However, mbassador catches exceptions thrown by subscribers. Is it possible to simply pass the exception through to the publisher?

bennidi commented 9 years ago

Hi Stephan, with much of delay I answer your question in a way you might have already expected. There is no such functionality available, that would allow the sender of a message to receive exceptions related to his publication. There is the concept of error handlers that can be registered but the relation with the calling code must be established using custom logic.