summaryrefslogtreecommitdiff
path: root/bridges/source/cpp_uno/gcc3_linux_intel/uno2cpp.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'bridges/source/cpp_uno/gcc3_linux_intel/uno2cpp.cxx')
-rw-r--r--bridges/source/cpp_uno/gcc3_linux_intel/uno2cpp.cxx24
1 files changed, 20 insertions, 4 deletions
diff --git a/bridges/source/cpp_uno/gcc3_linux_intel/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_intel/uno2cpp.cxx
index d9ead282e42a..ff8618cf8171 100644
--- a/bridges/source/cpp_uno/gcc3_linux_intel/uno2cpp.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_intel/uno2cpp.cxx
@@ -17,11 +17,17 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <sal/config.h>
+
+#include <exception>
+#include <typeinfo>
#include <sal/alloca.h>
#include <com/sun/star/uno/genfunc.hxx>
+#include <com/sun/star/uno/Exception.hpp>
#include <com/sun/star/uno/RuntimeException.hpp>
+#include <o3tl/runtimetooustring.hxx>
#include <uno/data.h>
#include <bridge.hxx>
@@ -155,10 +161,20 @@ void cpp_call(
try
{
assert( !( (pCppStack - pCppStackStart ) & 3) && "UNALIGNED STACK !!! (Please DO panic)" );
- CPPU_CURRENT_NAMESPACE::callVirtualMethod(
- pAdjustedThisPtr, aVtableSlot.index,
- pCppReturn, pReturnTypeDescr, bSimpleReturn,
- reinterpret_cast<sal_Int32 *>(pCppStackStart), (pCppStack - pCppStackStart) / sizeof(sal_Int32) );
+ try {
+ CPPU_CURRENT_NAMESPACE::callVirtualMethod(
+ pAdjustedThisPtr, aVtableSlot.index,
+ pCppReturn, pReturnTypeDescr, bSimpleReturn,
+ reinterpret_cast<sal_Int32 *>(pCppStackStart), (pCppStack - pCppStackStart) / sizeof(sal_Int32) );
+ } catch (css::uno::Exception &) {
+ throw;
+ } catch (std::exception & e) {
+ throw css::uno::RuntimeException(
+ "C++ code threw " + o3tl::runtimeToOUString(typeid(e).name()) + ": "
+ + o3tl::runtimeToOUString(e.what()));
+ } catch (...) {
+ throw css::uno::RuntimeException("C++ code threw unknown exception");
+ }
// NO exception occurred...
*ppUnoExc = nullptr;