#include <boost/python.hpp>
#include "alsutils/error/Exception.hpp"
Go to the source code of this file.
◆ HANDLE_PYTHON_EXCEPTION
#define HANDLE_PYTHON_EXCEPTION |
Value:std::string pythonErrorMessage = "none"; \
if (PyErr_Occurred()) { \
} \
boost::python::handle_exception(); \
PyErr_Clear(); \
THROW("Error running python script:\n" << pythonErrorMessage)
std::string handle_pyerror()
Definition: handle_pyerror.hpp:25
Small macro to handle python exceptions, not in a function to allow for nicer stack trace.
From https://stackoverflow.com/a/6576177