Re: [QuantLib-svn] SF.net SVN: quantlib:[17435] trunk/QuantLib/ql

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: [QuantLib-svn] SF.net SVN: quantlib:[17435] trunk/QuantLib/ql

Luigi Ballabio
On Thu, 2010-10-21 at 16:14 +0000, [hidden email] wrote:

> Revision: 17435
>           http://quantlib.svn.sourceforge.net/quantlib/?rev=17435&view=rev
> Author:   nando
> Date:     2010-10-21 16:14:28 +0000 (Thu, 21 Oct 2010)
>
> Log Message:
> -----------
> added specialized handling of std::exception
>
> @@ -138,6 +142,9 @@
>                                    // case of bootstrapping
>              try {
>                  performCalculations();
> +            } catch (std::exception& e) {
> +                calculated_ = false;
> +                throw e;
>              } catch (...) {
>                  calculated_ = false;
>                  throw;

Nando,
        that's not specialized.  The two catch clauses do the same thing (i.e.,
the same exception that's caught is rethrown.)  Did you have any
problems with the previous version? What behavior did you see that you
were trying to fix?

Luigi


--

There are no rules of architecture for a castle in the clouds.
-- Gilbert K. Chesterton



------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev
Reply | Threaded
Open this post in threaded view
|

Re: [QuantLib-svn] SF.net SVN: quantlib:[17435] trunk/QuantLib/ql

Kakhkhor Abdijalilov
The first clause will try to rethrow a sliced down copy of e.
std::exception can't be constructed for a string. waht() method of the
rethrown object will return some implementation dependent message, not
the original error message.

Regards,
Kakhkhor Abdijalilov.

------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev
Reply | Threaded
Open this post in threaded view
|

Re: [QuantLib-svn] SF.net SVN: quantlib:[17435] trunk/QuantLib/ql

Luigi Ballabio
On Thu, 2010-10-21 at 15:07 -0500, Kakhkhor Abdijalilov wrote:
> The first clause will try to rethrow a sliced down copy of e.
> std::exception can't be constructed for a string. waht() method of the
> rethrown object will return some implementation dependent message, not
> the original error message.

Correct--see the attached test program.  You're slicing the message
away, so it seems like you're doing the opposite of what you meant...

Later,
        Luigi


--

These are my principles, and if you don't like them... Well, I have
others.
-- Groucho Marx


------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev

test.cpp (1K) Download Attachment