summaryrefslogtreecommitdiff
path: root/py/modules/IcePy/Util.h
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2005-09-09 21:58:29 +0000
committerMark Spruiell <mes@zeroc.com>2005-09-09 21:58:29 +0000
commit704e389b7b222ba9b451490682517c0a73d1687f (patch)
tree48c578adf5e13d7ae79da9f0170983c15ee6ea35 /py/modules/IcePy/Util.h
parentrestoring version 1.6 (diff)
downloadice-704e389b7b222ba9b451490682517c0a73d1687f.tar.bz2
ice-704e389b7b222ba9b451490682517c0a73d1687f.tar.xz
ice-704e389b7b222ba9b451490682517c0a73d1687f.zip
preserve exception stack trace for UnknownException
Diffstat (limited to 'py/modules/IcePy/Util.h')
-rw-r--r--py/modules/IcePy/Util.h40
1 files changed, 38 insertions, 2 deletions
diff --git a/py/modules/IcePy/Util.h b/py/modules/IcePy/Util.h
index 6408c4c065c..c74edb81d81 100644
--- a/py/modules/IcePy/Util.h
+++ b/py/modules/IcePy/Util.h
@@ -44,6 +44,39 @@ private:
};
//
+// Manages the interpreter's exception.
+//
+class PyException
+{
+public:
+
+ //
+ // Retrieves the interpreter's current exception.
+ //
+ PyException();
+
+ //
+ // Uses the given exception.
+ //
+ PyException(PyObject*);
+
+ //
+ // Convert the Python exception to its C++ equivalent.
+ //
+ void raise();
+
+ PyObjectHandle ex;
+
+private:
+
+ void raiseLocalException();
+ std::string getTraceback();
+
+ PyObjectHandle _type;
+ PyObjectHandle _tb;
+};
+
+//
// Release Python's Global Interpreter Lock during potentially time-consuming
// (and non-Python related) work.
//
@@ -95,7 +128,7 @@ PyObject* lookupType(const std::string&);
//
// Returns the current Python exception.
//
-PyObject* getPythonException(bool = true);
+//void getPythonException(PyObjectHandle&, PyObjectHandle&, bool);
//
// Creates an exception instance of the given type.
@@ -114,8 +147,11 @@ void setPythonException(const Ice::Exception&);
//
// Converts a Python exception into an Ice exception and throws it.
+// If no exception is provided, the interpreter's current exception
+// is obtained. The second argument is an optional traceback object.
//
-void throwPythonException(PyObject* = NULL);
+//void throwPythonException(PyObject* = NULL, PyObject* = NULL);
+void throwPythonException();
//
// Handle the SystemExit exception.