Boost logo

Boost Users :

Subject: Re: [Boost-users] [python] intercepting uncaught exceptions
From: Gennadiy Rozental (rogeeff_at_[hidden])
Date: 2011-03-01 02:13:45


Juraj Ivančić <juraj.ivancic <at> gmail.com> writes:

> Boost.Python throws error_already_set exception in case
> PyErr_Occurred() is true, and here PyErr functions kick in. Perhaps
> PyErr_Fetch() and PyErr_Restore() are what you're looking for?

These I am using already. The problem is that I am running different pieces of
embedded code in different "execution environments" with different global and
local dictionaries associated with different Boost.Python object being executed.

I need an ability to treat an error slightly differently depending on which
"environment" an error occurred in. Thus I need to know what was the global
dictionary at the time (or something similar identifying the "environment").

I hoped I can attach something to the traceback object, but I need to somehow
intercept it.

Gennadiy


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net