MCPcopy Create free account
hub / github.com/JSBSim-Team/jsbsim / convertJSBSimToPyExc

Function convertJSBSimToPyExc

python/src/ExceptionManagement.h:41–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39PyObject* logexception_error;
40
41void convertJSBSimToPyExc()
42{
43 try {
44 if (!PyErr_Occurred())
45 throw;
46 }
47 catch (const JSBSim::TrimFailureException& e) {
48 PyErr_SetString(trimfailure_error, e.what());
49 }
50 catch (const GeographicLib::GeographicErr& e) {
51 PyErr_SetString(geographic_error, e.what());
52 }
53 catch (const JSBSim::LogException& e) {
54 PyErr_SetString(logexception_error, e.what());
55 }
56 catch (const JSBSim::BaseException& e) {
57 PyErr_SetString(base_error, e.what());
58 }
59 catch (const JSBSim::FloatingPointException& e) {
60 PyErr_SetString(e.getPyExc(), e.what());
61 }
62 catch (const std::string &msg) {
63 PyErr_SetString(PyExc_RuntimeError, msg.c_str());
64 }
65 catch (const char* msg) {
66 PyErr_SetString(PyExc_RuntimeError, msg);
67 }
68}
69}
70#endif // EXCEPTIONMANAGEMENT_H

Callers

nothing calls this directly

Calls 3

getPyExcMethod · 0.80
c_strMethod · 0.80
whatMethod · 0.45

Tested by

no test coverage detected