summaryrefslogtreecommitdiff
path: root/pyuno/source/loader/pyuno_loader.cxx
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2016-06-21 12:46:45 +0200
committerStephan Bergmann <sbergman@redhat.com>2016-06-21 12:46:45 +0200
commit038069806e4e2a8760fa415a23c28ccd338239f4 (patch)
tree601890911cabdf1f45730541c8c3544a326c92ba /pyuno/source/loader/pyuno_loader.cxx
parentcc66f408f99602618be12ce6c47152233291e1db (diff)
Clean up uses of Any::getValue() in pyuno
Change-Id: I35c4ac0b84e439982f87420aa7587c99ee367920
Diffstat (limited to 'pyuno/source/loader/pyuno_loader.cxx')
-rw-r--r--pyuno/source/loader/pyuno_loader.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/pyuno/source/loader/pyuno_loader.cxx b/pyuno/source/loader/pyuno_loader.cxx
index ef16cfb1872e..af835411d115 100644
--- a/pyuno/source/loader/pyuno_loader.cxx
+++ b/pyuno/source/loader/pyuno_loader.cxx
@@ -22,6 +22,8 @@
#include <pyuno.hxx>
+#include <o3tl/any.hxx>
+
#include <osl/process.h>
#include <osl/file.hxx>
#include <osl/thread.h>
@@ -71,8 +73,8 @@ static void raiseRuntimeExceptionWhenNeeded() throw ( RuntimeException )
css::uno::Any a = runtime.extractUnoException( excType, excValue, excTraceback );
OUStringBuffer buf;
buf.append( "python-loader:" );
- if( a.hasValue() )
- buf.append( static_cast<css::uno::Exception const *>(a.getValue())->Message );
+ if( auto e = o3tl::tryAccess<css::uno::Exception>(a) )
+ buf.append( e->Message );
throw RuntimeException( buf.makeStringAndClear() );
}
}