exception.cpp
Go to the documentation of this file.
1 /*
2  * Copyright 2014-2019, CNRS
3  * Copyright 2018-2019, INRIA
4  */
5 
6 #include "eigenpy/exception.hpp"
7 
8 #include <boost/python/exception_translator.hpp>
9 
10 #include "eigenpy/registration.hpp"
11 
12 namespace eigenpy {
13 PyObject* Exception::pyType;
14 
16  assert(NULL != pyType);
17  // Return an exception object of type pyType and value object(e).
18  PyErr_SetString(PyExc_RuntimeError, e.what());
19 }
20 
22  if (check_registration<eigenpy::Exception>()) return;
23 
24  pyType = boost::python::class_<eigenpy::Exception>(
25  "Exception", boost::python::init<std::string>())
26  .add_property("message", &eigenpy::Exception::copyMessage)
27  .ptr();
28 
29  boost::python::register_exception_translator<eigenpy::Exception>(
31 }
32 
33 } // namespace eigenpy
registration.hpp
eigenpy::Exception::registerException
static void registerException()
Definition: exception.cpp:21
eigenpy::Exception::what
const char * what() const
Definition: exception.hpp:23
eigenpy
Definition: alignment.hpp:14
eigenpy::Exception::copyMessage
std::string copyMessage() const
Definition: exception.hpp:26
eigenpy::Exception::translateException
static void translateException(Exception const &e)
Definition: exception.cpp:15
eigenpy::Exception
Definition: exception.hpp:19
exception.hpp
eigenpy::Exception::pyType
static PyObject * pyType
Definition: exception.hpp:34


eigenpy
Author(s): Justin Carpentier, Nicolas Mansard
autogenerated on Sat Nov 2 2024 02:14:45