Skip to content

Commit ced5cf9

Browse files
committed
Add getters for exception type, value and traceback
1 parent e2b884c commit ced5cf9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

include/pybind11/pytypes.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,10 @@ class error_already_set : public std::runtime_error {
346346
/// the given tuple.
347347
bool matches(handle ex) const { return PyErr_GivenExceptionMatches(ex.ptr(), type.ptr()); }
348348

349+
const object& get_type() { return type; } const
350+
const object& get_value() { return value; } const
351+
const object& get_trace() { return trace; } const
352+
349353
private:
350354
object type, value, trace;
351355
};

0 commit comments

Comments
 (0)