17#ifndef PYOPAL_PYCORE_EXCEPTIONTRANSLATION_H
18#define PYOPAL_PYCORE_EXCEPTIONTRANSLATION_H 1
21#include <structmember.h>
26#include <boost/python.hpp>
29namespace py = boost::python;
32namespace ExceptionTranslation {
40 PyErr_SetString(PyExc_RuntimeError, exception.what());
46 std::string msg = exception.what()+
" in C++ method "+exception.where();
47 PyErr_SetString(PyExc_RuntimeError, msg.c_str());
void translateOpalException(T const &exception)
Translates the OpalExceptions into a RuntimeError.
void registerExceptions()
Register exception translations with boost.
void translateException(T const &exception)
Translates the std::exceptions into a RuntimeError.