gjb has asked for the wisdom of the Perl Monks concerning the following question:
Dear fellow Monks,
After doing a supersearch, a scan of all relevant docs and a grep on the .xs files of all the modules I've installed on my machine I didn't get a clue, so I'd like to seek your collective wisdom.
I'm currently writing a Perl module that interfaces to a C++ library. In several functions of this library, exceptions are thrown of a type I know, so in the XS code I use
to deal with it and to wrap the error message into a croak(...) for Perl consumption.try { ... } catch{MyException& e) { ... } catch(...) { ... }
Upon testing it seems as if the C++ code throws the expected exception alright (this has been verified by the author of the C++ code), but in the XS code I can't catch that exception. However, something gets caught in the generic catch catch(...). I have turned on exception handling with the compiler option -GX.
Hence my question: has anyone successfully caught typed C++ exceptions in XS in this setup (NT 4.0 SP 5, ActiveState Perl 5.6.1 build 633, MSVC++ 6.0) or is there some advice you could offer?
Thanks in advance, -gjb-
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: XS & exception handling
by Zaxo (Archbishop) on Jan 09, 2003 at 13:32 UTC | |
|
Re: XS & exception handling (C vs. C++)
by tye (Sage) on Jan 09, 2003 at 18:36 UTC | |
|
Re: XS & exception handling
by broquaint (Abbot) on Jan 10, 2003 at 14:50 UTC | |
|
Re: XS & exception handling (pinpointed)
by gjb (Vicar) on Jan 13, 2003 at 09:57 UTC |