Error messages returned by quantlib exceptions

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

Error messages returned by quantlib exceptions

Luca Berardi
Hi all,

I recently moved from Visual C++ 6.0 to Visual C++ 7.1 (.Net 2003). I noticed
that error messages returned by quantlib exceptions (namely by means of the
macros QL_REQUIRE and QL_FAIL), in addition to the string set by the user,
have a very long prefix and sometimes are truncated.
Is it possible to restore the old format, i.e. the one with only the error
message set by the user (and maybe the source file with the line number too)?

Thanks in advance.

Luca


__________________________________________________________________
TISCALI ADSL 1.25 MEGA
Solo con Tiscali Adsl navighi senza limiti di tempo
e telefoni senza canone Telecom da 19,95 euro/mese.
Attivala entro il 20 luglio, IL PRIMO MESE E' GRATIS
Scopri come, clicca qui
http://abbonati.tiscali.it/adsl/sa/1e25flat_tc/





Reply | Threaded
Open this post in threaded view
|

Re: Error messages returned by quantlib exceptions

Luigi Ballabio
On 07/12/2005 06:48:37 PM, Luca Berardi wrote:
> I recently moved from Visual C++ 6.0 to Visual C++ 7.1 (.Net 2003). I
> noticed that error messages returned by quantlib exceptions (namely  
> by means of the macros QL_REQUIRE and QL_FAIL), in addition to the  
> string set by the user, have a very long prefix and sometimes are  
> truncated.
> Is it possible to restore the old format, i.e. the one with only the
> error message set by the user (and maybe the source file with the  
> line number too)?

Yes. You have to edit errors.cpp and remove from the two  
implementations of the format() function the lines:

         if (function != "(unknown)")
             msg << function << ": ";

I'll try and provide a configuration option in next release.

Later,
        Luigi

----------------------------------------

standards, n.:
         The principles we use to reject other people's code.