Boost logo

Boost Users :

Subject: Re: [Boost-users] [Boost.Exception] A couple of unspotted areas
From: Agustín K-ballo Bergé (kaballo86_at_[hidden])
Date: 2012-07-19 14:17:49


On 19/07/2012 10:56 a.m., Alexander Mingalev wrote:
>
> catch (const std::exception& e)
> {
> throw boost::enable_error_info(e) << Tag1(1);
> }

I believe that should be

     catch(boost::exception& e)
     {
         e << Tag1(1);
         throw; // rethrow original exception
     }

so to preserve the original exception being thrown. You are currently
throwing a new exception copied from std::exception e.

Agustín K-ballo Bergé.-
http://fusionfenix.com


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