Skip to content

Commit

Permalink
make sure not to loose python init error info on exception
Browse files Browse the repository at this point in the history
  • Loading branch information
hellkite500 committed Apr 26, 2023
1 parent ca76cc6 commit 6ab044e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions include/realizations/catchment/Bmi_Py_Adapter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,10 @@ namespace models {
if (init_exception_msg.empty()) {
init_exception_msg = "Unknown Python model initialization exception.";
}
//This message is lost and often contains valuable info. Either need to break up and catch
//other possible exceptions, wrap all these in a custom exception, or at the very least, print
//the original messge before it gets lost in this re-throw.
std::cerr<<init_exception_msg<<std::endl;
throw e;
}
}
Expand Down

0 comments on commit 6ab044e

Please sign in to comment.