@@ -100,8 +100,9 @@ class AsyncCommsWrapper : public MOOS::MOOSAsyncCommClient {
100100 bResult = py::bool_ (result);
101101 } catch (const py::error_already_set& e) {
102102 PyGILState_Release (gstate);
103- throw pyMOOSException (
104- " OnConnect:: caught an exception thrown in python callback" );
103+ std::string err_msg = " OnConnect:: caught an exception thrown in python callback:\n " ;
104+ err_msg.append (e.what ());
105+ throw pyMOOSException (err_msg.c_str ());
105106 }
106107
107108 PyGILState_Release (gstate);
@@ -133,8 +134,9 @@ class AsyncCommsWrapper : public MOOS::MOOSAsyncCommClient {
133134 }
134135 } catch (const py::error_already_set& e) {
135136 PyGILState_Release (gstate);
136- throw pyMOOSException (
137- " OnMail:: caught an exception thrown in python callback" );
137+ std::string err_msg = " OnMail:: caught an exception thrown in python callback:\n " ;
138+ err_msg.append (e.what ());
139+ throw pyMOOSException (err_msg.c_str ());
138140 }
139141
140142 PyGILState_Release (gstate);
@@ -165,8 +167,9 @@ class AsyncCommsWrapper : public MOOS::MOOSAsyncCommClient {
165167 bResult = py::bool_ (result);
166168 } catch (const py::error_already_set& e) {
167169 PyGILState_Release (gstate);
168- throw pyMOOSException (
169- " ActiveQueue:: caught an exception thrown in python callback" );
170+ std::string err_msg = " ActiveQueue:: caught an exception thrown in python callback:\n " ;
171+ err_msg.append (e.what ());
172+ throw pyMOOSException (err_msg.c_str ());
170173 }
171174
172175 PyGILState_Release (gstate);
0 commit comments