Skip to content

Commit

Permalink
Fix: exception caused by failure to find schema file not being swig-w…
Browse files Browse the repository at this point in the history
…rapped correctly.
  • Loading branch information
Tim Hutton committed Aug 23, 2016
1 parent f845f24 commit a5fe2a9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Malmo/src/CSharpWrapper/MalmoNETNative.i
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,10 @@ public:
std::ostringstream oss;
oss << "Caught xml_schema::exception: " << e.what() << "\n" << e;
SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, oss.str().c_str());
} catch (const std::runtime_error& e) {
std::ostringstream oss;
oss << "Caught std::runtime_error: " << e.what();
SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, oss.str().c_str());
}
%}

Expand Down
5 changes: 5 additions & 0 deletions Malmo/src/JavaWrapper/MalmoJava.i
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,11 @@ public:
oss << "Caught xml_schema::exception: " << e.what() << "\n" << e;
jclass clazz = jenv->FindClass("java/lang/Exception");
jenv->ThrowNew(clazz, oss.str().c_str());
} catch (const std::runtime_error& e) {
std::ostringstream oss;
oss << "Caught std::runtime_error: " << e.what();
jclass clazz = jenv->FindClass("java/lang/Exception");
jenv->ThrowNew(clazz, oss.str().c_str());
}
%}

Expand Down

0 comments on commit a5fe2a9

Please sign in to comment.