Submitter: David McNamara <dlmcn22203@users.sf.net>
Assignee: <>
I think that it would be nice if the automatically
generated exceptions in Python contained the
information from the C exceptions on which they are
based. Take the following example:
C++ member function prototype
bool load_data(const char* path) throw(std::bad_alloc);
resulting snippet of SWIG generated code:
try {
result = (bool)(arg1)->load_data((char const *)arg2);
C++ member function prototype bool load_data(const char* path) throw(std::bad_alloc);
resulting snippet of SWIG generated code: try { result = (bool)(arg1)->load_data((char const *)arg2);
} catch(std::bad_alloc &_e) { { PyErr_SetString(PyExc_RuntimeError,"std::bad_alloc"); SWIG_fail; } }
Perhaps it is possible to concatenate _e.what() with the existing string label ("std::bad_alloc")?