Boost logo

Boost :

Subject: Re: [boost] [1.55b1][coroutine][exception] not propagating exception type
From: Jeff Flinn (Jeffrey.Flinn_at_[hidden])
Date: 2013-10-29 15:46:48


On 10/29/2013 3:20 PM, Emil Dotchevski wrote:
> On Tue, Oct 29, 2013 at 12:00 PM, Jeff Flinn <Jeffrey.Flinn_at_[hidden]> wrote:
>> template< typename E >
>> void f14(coro_void_void::caller_type & , E const& e)
>> {
>> throw e;
>> }
>
> I haven't checked but if boost::exception_ptr is used to transport
> this exception to another thread, then you should call
> boost::throw_exception instead of using throw directly.

Indeed!

template< typename E >
void f14(coro_void_void::caller_type & , E const& e)
{
   boost::throw_exception(e);
}

works as expected.

Oliver suggested:

boost::throw_exception(boost::enable_current_exception(e));

As the previous gives me the expected behavior(at least on the surface),
I'm not sure what this latter provides even after a quick read of the docs.

Thanks, Jeff


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk