summaryrefslogtreecommitdiff
path: root/bridges/source/cpp_uno/gcc3_linux_sparc/uno2cpp.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'bridges/source/cpp_uno/gcc3_linux_sparc/uno2cpp.cxx')
-rw-r--r--bridges/source/cpp_uno/gcc3_linux_sparc/uno2cpp.cxx32
1 files changed, 25 insertions, 7 deletions
diff --git a/bridges/source/cpp_uno/gcc3_linux_sparc/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_sparc/uno2cpp.cxx
index 99d60d17f351..39b625fb35c2 100644
--- a/bridges/source/cpp_uno/gcc3_linux_sparc/uno2cpp.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_sparc/uno2cpp.cxx
@@ -17,8 +17,16 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <sal/config.h>
+
+#include <exception>
#include <malloc.h>
+#include <typeinfo>
+
+#include <com/sun/star/uno/Exception.hpp>
+#include <com/sun/star/uno/RuntimeException.hpp>
#include <com/sun/star/uno/genfunc.hxx>
+#include <o3tl/runtimetooustring.hxx>
#include <uno/data.h>
#include "bridge.hxx"
@@ -395,13 +403,23 @@ static void cpp_call(
if( nStackLongs & 1 )
// stack has to be 8 byte aligned
nStackLongs++;
- callVirtualMethod(
- pAdjustedThisPtr,
- aVtableSlot.index,
- pCppReturn,
- pReturnTypeDescr->eTypeClass,
- (sal_Int32 *)pCppStackStart,
- nStackLongs);
+ try {
+ callVirtualMethod(
+ pAdjustedThisPtr,
+ aVtableSlot.index,
+ pCppReturn,
+ pReturnTypeDescr->eTypeClass,
+ (sal_Int32 *)pCppStackStart,
+ nStackLongs);
+ } 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 = 0;