libunifex icon indicating copy to clipboard operation
libunifex copied to clipboard

Consistently catch exceptions thrown from set_value() calls

Open lewissbaker opened this issue 4 years ago • 1 comments

The requirement for set_value() implementations was relaxed to allow them to throw exceptions. However, this now means we need to audit all call-sites to unifex::set_value() to ensure that we catch exceptions and reflect the error back to unifex::set_error().

Some of this could be helped by a unifex::nothrow_set_value() helper that wraps up this pattern for us conditionally based on whether calling set_value() is noexcept or not.

Places where this needs to be done:

  • inline_scheduler
  • manual_event_loop::schedule() operation
  • ready_done_sender
  • stop_immediately concrete_receiver

We also need to update pretty much all of these senders to have error_types that indicates that they might send an exception_ptr since they don't yet know whether they will be connected to a receiver that has a potentially-throwing set_value() method.

lewissbaker avatar Mar 12 '20 20:03 lewissbaker

I'm doing this for inline_scheduler in the latest iteration of PR #225.

ispeters avatar Feb 10 '21 07:02 ispeters