diff --git a/simgear/nasal/cppbind/detail/to_nasal_helper.cxx b/simgear/nasal/cppbind/detail/to_nasal_helper.cxx index a0c76b20..e8d77090 100644 --- a/simgear/nasal/cppbind/detail/to_nasal_helper.cxx +++ b/simgear/nasal/cppbind/detail/to_nasal_helper.cxx @@ -21,6 +21,7 @@ #include #include +#include #include #include @@ -101,13 +102,11 @@ namespace nasal { return (*func)(nasal::CallContext(c, me, argc, args)); } - catch(const std::exception& ex) + // CppUnit::Exception inherits std::exception, so restrict ourselves to + // sg_exception + catch (const sg_exception& e) { - naRuntimeError(c, "Fatal error in Nasal call: %s", ex.what()); - } - catch(...) - { - naRuntimeError(c, "Unknown exception in Nasal call."); + naRuntimeError(c, "Fatal error in Nasal call: %s", e.what()); } return naNil();