On 17/02/2015 01:51, Marvin Humphrey wrote:
On Mon, Feb 16, 2015 at 11:55 AM, Nick Wellnhofer <[email protected]> wrote:
Can't we simply convert a Clownfish exception to a Python exception in
cfish_Err_do_throw (and convert it back in cfish_Err_trap)?
Yes, but the problem is that such a mechanism prevents catching specific
classes of exceptions. In my provisional Python bindings, all Python method
wrappers run Clownfish code inside Err_trap, and if the Clownfish code throws
an exception, it's stringified and used as the message inside a Python
RuntimeError. Catching all RuntimeErrors is too broad.
Hmm, what about adding a "type" or "host_class" field to Clownfish::Err and
use it to convert to exception objects of different classes.
Nick