OPAL (Object Oriented Parallel Accelerator Library) 2022.1
OPAL
ExceptionTranslation.h
Go to the documentation of this file.
1#include <Python.h>
2#include <structmember.h>
3
4#include <string>
5#include <exception>
6
7#include <boost/python.hpp>
8
9namespace PyOpal {
10namespace py = boost::python;
11
12namespace ExceptionTranslation {
13
15
16template <class T>
17void translateException(T const& exception) {
18 PyErr_SetString(PyExc_RuntimeError, exception.what());
19}
20
21template <class T>
22void translateOpalException(T const& exception) {
23 std::string msg = exception.what()+" in C++ method "+exception.where();
24 PyErr_SetString(PyExc_RuntimeError, msg.c_str());
25}
26
27
28}
29}
void translateOpalException(T const &exception)
void translateException(T const &exception)