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

feature request: throw_exception customization point #25

Closed
zlojvavan opened this issue Sep 11, 2019 · 4 comments
Closed

feature request: throw_exception customization point #25

zlojvavan opened this issue Sep 11, 2019 · 4 comments

Comments

@zlojvavan
Copy link

what about introducing end user customization point facility? at the moment one can specialize throw_exception template using any specific type but providing specialization for the entire class hierarchy looks somewhat problematic

@zajo
Copy link
Collaborator

zajo commented Oct 15, 2019

What customization do you need? The only reason you'd call throw_exception rather than just use throw is to support BOOST_NO_EXCEPTIONS configurations. It is always illegal to return from throw_exception.

@zlojvavan
Copy link
Author

I'm not talking about returning from throw_exception
for example one may want to replace exception instance with another class or just "enrich" it with say callstack info, etc.

@zajo
Copy link
Collaborator

zajo commented Feb 18, 2020

Like I said, throw_exception is not a customization point. When a library author wants to throw an exception, it shouldn't be up to the user to change the exception type. It exists solely to allow Boost to be used under -fno-exceptions.

@zajo zajo closed this as completed Feb 18, 2020
@zlojvavan
Copy link
Author

it's not and that's why I filed request as it's better be that customization point. changing exception type is somewhat extreme example (though if the type is derived from the thrown type it won't really hurt) but enriching it by simple replacing text or adding extra info such as say call stack as demonstrated in BOOST_THROW_EXCEPTION macro and/or in https://www.boost.org/doc/libs/1_72_0/doc/html/stacktrace/getting_started.html#stacktrace.getting_started.exceptions_with_stacktrace is very useful feature

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

2 participants