Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Classify Exceptions #317

Open
CayOest opened this issue Apr 27, 2023 · 0 comments
Open

Classify Exceptions #317

CayOest opened this issue Apr 27, 2023 · 0 comments

Comments

@CayOest
Copy link

CayOest commented Apr 27, 2023

Hi,

So I found out that there is the very useful difference between ChannelException and ConnectionException. Soft and hard exception.
So I thought the ConsumerTagNotFoundException was a soft exception, a ChannelException.
But it wasn't. It was directly inheriting std::runtime_error which was really confusing, because it wasn't even an AmqpException which is supposed to be the base class for every exception thrown by this library.

So what I'd really like would be:

  • Every exception defined in this library should be derived from AmpqException (No way that I am catching AmqpExceptions in good faith only to find out 1 hour later that this particular exception defined here is a std::runtime_error).
  • Don't make the difference between soft and hard altogether. Make it clear in the comments that a ConnectionException is really, really heavy, and one needs to reconnect.
    There is no soft and hard from a user perspective. Yes, ConnectionException is always hard, but any other exception might be hard at this point in time for this particular user as well. Let the user decide what's hard and what not, just make it clear to him what e. g. ConnectionException entails. C++ devs can handle and count on reliable exception hierarchies, so make sure that all your exceptions are within a reliable hierarchy.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant