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

Catch block for boost::exception appears after std::exception in execution_monitor::execute() #147

Closed
k15tfu opened this Issue May 23, 2018 · 6 comments

Comments

Projects
None yet
2 participants
@k15tfu

k15tfu commented May 23, 2018

So, if I throw myexception defined as struct myexception : std::exception, virtual boost::exception it prints uninformative message

@raffienficiaud

This comment has been minimized.

Member

raffienficiaud commented May 23, 2018

Give a snippet, define uninformative, and please read the contribution file on how to file a bug ticket.

@k15tfu

This comment has been minimized.

k15tfu commented May 24, 2018

If you prefer to use Boost Trac why you haven't disabled Issues tab on GitHub?

using error_code = boost::error_info<struct tag_error_code, uint32_t>;
struct myexception : std::exception, virtual boost::exception {};

BOOST_AUTO_TEST_CASE(is_always_lock_free) {
  BOOST_THROW_EXCEPTION(myexception << error_code(123));
}

At the moment the exception will be catch as std::exception:

test.cpp(66): fatal error: in "void __cdecl `anonymous-namespace'::is_always_lock_free::test_method(void)": class boost::exception_detail::clone_impl<struct myexception>: Unknown exception

Well.. I swapped the boost::exception && std::exception and the only difference was in showing "Unknown exception" message. Sorry, thought it will use boost::diagnostic_information() instead of unknown-exception phrase.

But isn't it right to catch more narrowed (non generic) exceptions first?

@raffienficiaud

This comment has been minimized.

Member

raffienficiaud commented Sep 2, 2018

What happens if you derive only from boost::exception? and recently Trac has been closed to new tickets.

@raffienficiaud

This comment has been minimized.

Member

raffienficiaud commented Sep 12, 2018

@k15tfu Would you please test the branch topic/GH-147-boost-exception-before-std-exception?

raffienficiaud added a commit that referenced this issue Sep 29, 2018

Merge branch 'topic/GH-147-boost-exception-before-std-exception' into…
… next-internal

* topic/GH-147-boost-exception-before-std-exception:
  Change log
  Catching boost::exception before std::exception
@raffienficiaud

This comment has been minimized.

Member

raffienficiaud commented Sep 29, 2018

In next

raffienficiaud added a commit that referenced this issue Oct 1, 2018

Merge branch 'topic/GH-147-boost-exception-before-std-exception' into…
… develop

* topic/GH-147-boost-exception-before-std-exception:
  Change log
  Catching boost::exception before std::exception
@raffienficiaud

This comment has been minimized.

Member

raffienficiaud commented Oct 2, 2018

In develop, closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment