Code Monkey home page Code Monkey logo

Comments (5)

bdominguez avatar bdominguez commented on June 26, 2024 1

I would choose the second option, setting if you want to 'false' by default to keep it working the same.

from redbus.

mxjones avatar mxjones commented on June 26, 2024

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.

bdominguez avatar bdominguez commented on June 26, 2024

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.

mxjones avatar mxjones commented on June 26, 2024

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.

mxjones avatar mxjones commented on June 26, 2024

Added option to throw subscriber exceptions in 1.0.7

from redbus.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.