Alexandria  2.25.0
SDC-CH common library for the Euclid project
ExceptionRaiser.h
Go to the documentation of this file.
1 
19 #ifndef PYSTON_EXCEPTIONRAISER_H
20 #define PYSTON_EXCEPTIONRAISER_H
21 
22 #include "Pyston/Graph/Node.h"
24 #include <boost/python/errors.hpp>
25 #include <memory>
26 #include <string>
27 
28 namespace Pyston {
29 
36 template <typename T>
38 public:
46  ExceptionRaiser(const std::string& msg, bool recoverable) : m_msg{msg}, m_recoverable{recoverable} {}
47 
54  if (m_recoverable)
55  throw RecoverableError(m_msg.c_str());
56  else
58  }
59 
60 private:
63 };
64 
65 } // end of namespace Pyston
66 
67 #endif // PYSTON_EXCEPTIONRAISER_H
T c_str(T... args)
ExceptionRaiser(const std::string &msg, bool recoverable)
void operator()(const std::shared_ptr< Node< T >> &)