|
Boost Users : |
Subject: Re: [Boost-users] [exception] Passing existing exception hierarchies between threads
From: Emil Dotchevski (emildotchevski_at_[hidden])
Date: 2012-07-02 15:16:35
On Mon, Jul 2, 2012 at 3:13 AM, Szymon Gatner <szymon.gatner_at_[hidden]>wrote:
> I am trying to pass Poco::Exeption from worker thread to a client
> thread/future. Idea is simple:
>
> try
> {
> operationThatMyThrowPocoException();
> }
> catch (const Poco::Exception& e)
> {
> // rethrow with exception_ptr support so can be passed between threads
> BOOST_THROW_EXCEPTION(e);
> }
>
You understand that the above code will erase the type of the exception
object in case what got thrown initially is of type that derives from
Poco::Exception, right?
> Is there a way to use BOOST_THROW_EXCEPTION /
> enable_current_exception() with existing exception hierarchies that
> define clone() already?
>
Probably not. If your exceptions can already be cloned, you can clone them
that way.
Emil Dotchevski
Reverge Studios, Inc.
http://www.revergestudios.com/reblog/index.php?n=ReCode
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net