diff --git a/Malmo/src/CSharpWrapper/MalmoNETNative.i b/Malmo/src/CSharpWrapper/MalmoNETNative.i index 076e50ba6..35e82a374 100755 --- a/Malmo/src/CSharpWrapper/MalmoNETNative.i +++ b/Malmo/src/CSharpWrapper/MalmoNETNative.i @@ -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()); } %} diff --git a/Malmo/src/JavaWrapper/MalmoJava.i b/Malmo/src/JavaWrapper/MalmoJava.i index 1da6d6966..299120f9c 100755 --- a/Malmo/src/JavaWrapper/MalmoJava.i +++ b/Malmo/src/JavaWrapper/MalmoJava.i @@ -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()); } %}