[Haskell-cafe] C++ exception (from *.so) catchable by Haskell??

Nick Rudnick nick.rudnick at gmail.com
Thu Feb 13 11:43:51 UTC 2014


Dear all,

after trying around a while this seems to be a good question for
Haskell-cafe to me: Is somewhere a place (e.g. some Hackage package) where
intercepting exceptions from C++ library code is done, so one can look
*how* it is done?

Generally, it is the following:
1) Injecting code that throws a an exception in C++ library code, e.g.,

throw runtime_error("OOOPS...");


2) then, I tried out everything in reach (Haskell docs, Hackage interfaces
to C++ considered to be well-done) to get it caught (try, catch, bracket,
finally; various exception types; forkOS).

3) To my surprise, every time the output stays the same:

terminate called after throwing an instance of 'std::runtime_error'
  what():  OOOPS...

Is it possible at all to get a grip of this? Is there some place where it
is done? Does the terminate call already happen with the C++ execution?

Any comment welcome, cheers, Nick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20140213/1abf5399/attachment.html>


More information about the Haskell-Cafe mailing list