Comments (5)
I would choose the second option, setting if you want to 'false' by default to keep it working the same.
from redbus.
I can add exposing exceptions here, but we do not want to throw at this point because other subscriptions will be missed - a subscription should handle any exceptions in its own code that is run on publish.
Also, throwing here would mean exposing an exception from a subscription, to the publisher and the publisher should have no knowledge, or care about subscribers.
Hope that makes sense.
from redbus.
Think of the case where I don't have my own code in a try/catch.
In that case you are going to handle the exception but as you do nothing with it you "hide it", that's what's dangerous and what can take hours to debug.
See this:
https://rules.sonarsource.com/csharp/type/Vulnerability/RSPEC-2486
from redbus.
This is true, but I don't think throwing the exception here is the better option - for the reasons I mentioned before.
This code doesn't care about exceptions raised by the code it calls into, and definetly doesn't want other subscribers to not get messages because a unrelated different subscriber had an error.
What do you think of some event that you can subscribe to that exposes any exceptions raised, like a global handler? So you can have something that subscribes to that and gets events raised on any exceptions here? Or, I guess I could expose some configuration that would allow exceptions to be thrown so you could specify the behaviour you want. Which would be your preference on this?
from redbus.
Added option to throw subscriber exceptions in 1.0.7
from redbus.
Related Issues (8)
- Exception : Collection has changed while changing it HOT 4
- Why an EventBase abstract class?
- No messages received with wrapped method HOT 2
- Implement Weak References HOT 2
- Split out implementation and interfaces into a separate packages HOT 2
- EventBus could attempt to publish to unsubscribed subscription HOT 2
- Remove unnecessary dependencies HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from redbus.