Conditional Exception Handling

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

Conditional Exception Handling

Lapin
Hi,

I would like to fill an array with teh engine results, but sometimes greeks are not filled.
In this case QL will throw an exception that I can catch without any issues.

My issue lies in the fact I don't think we can do conditional exception handling. By this I mean I would like to do:

if( barrierOption.delta() != ERROR )
   output[i]   = barrierOption.delta();

Does anybody knows how to do within QL framework?

Thanks
Reply | Threaded
Open this post in threaded view
|

Re: Conditional Exception Handling

Luigi Ballabio
On Wed, 2007-10-03 at 08:43 -0700, Yomi wrote:
> My issue lies in the fact I don't think we can do conditional exception
> handling. By this I mean I would like to do:
>
> if( barrierOption.delta() != ERROR )
>    output[i]   = barrierOption.delta();
>
> Does anybody knows how to do within QL framework?

try {
    output[i]   = barrierOption.delta();
} catch (Error& e) {}

Luigi



--

I hate quotations.
-- Ralph Waldo Emerson



-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Conditional Exception Handling

Lapin
Hi Luigi,

Unfortunately I have tried this, but it stalls and then crashes.
I use XLW to interface QL with Excel, so maybe it comes from this part.

Thanks anyway.

Luigi Ballabio wrote
On Wed, 2007-10-03 at 08:43 -0700, Yomi wrote:
> My issue lies in the fact I don't think we can do conditional exception
> handling. By this I mean I would like to do:
>
> if( barrierOption.delta() != ERROR )
>    output[i]   = barrierOption.delta();
>
> Does anybody knows how to do within QL framework?

try {
    output[i]   = barrierOption.delta();
} catch (Error& e) {}

Luigi



--

I hate quotations.
-- Ralph Waldo Emerson



-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
QuantLib-users mailing list
QuantLib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/quantlib-users