diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-11-06 10:16:45 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-11-06 10:22:03 +0000 |
commit | 0ac7311562bc059d803aa61186b5a5fc7f7dd1a7 (patch) | |
tree | d8b84b608e7691f86876403c077542197b3af303 /ucb | |
parent | Fix error: call of overloaded 'append(int)' is ambiguous (diff) | |
download | core-0ac7311562bc059d803aa61186b5a5fc7f7dd1a7.tar.gz core-0ac7311562bc059d803aa61186b5a5fc7f7dd1a7.zip |
coverity#983984 Uncaught exception
Change-Id: I6a166a1691e39e21a4d765ca7dd0a7fcfba8126b
Diffstat (limited to 'ucb')
-rw-r--r-- | ucb/source/ucp/cmis/cmis_content.cxx | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/ucb/source/ucp/cmis/cmis_content.cxx b/ucb/source/ucp/cmis/cmis_content.cxx index 039b438c3b90..4bc9d0058def 100644 --- a/ucb/source/ucp/cmis/cmis_content.cxx +++ b/ucb/source/ucp/cmis/cmis_content.cxx @@ -17,6 +17,7 @@ #include <com/sun/star/io/XActiveDataSink.hpp> #include <com/sun/star/io/XActiveDataStreamer.hpp> #include <com/sun/star/lang/IllegalAccessException.hpp> +#include <com/sun/star/lang/WrappedTargetRuntimeException.hpp> #include <com/sun/star/task/InteractionClassification.hpp> #include <com/sun/star/ucb/ContentInfo.hpp> #include <com/sun/star/ucb/ContentInfoAttribute.hpp> @@ -40,6 +41,7 @@ #endif #include <comphelper/processfactory.hxx> +#include <cppuhelper/exc_hlp.hxx> #include <config_oauth2.h> #include <ucbhelper/cancelcommandexecution.hxx> #include <ucbhelper/content.hxx> @@ -1657,9 +1659,25 @@ namespace cmis OUString SAL_CALL Content::getContentType() throw( uno::RuntimeException, std::exception ) { - return isFolder( uno::Reference< ucb::XCommandEnvironment >() ) - ? OUString(CMIS_FOLDER_TYPE) - : OUString(CMIS_FILE_TYPE); + OUString sRet; + try + { + sRet = isFolder( uno::Reference< ucb::XCommandEnvironment >() ) + ? OUString(CMIS_FOLDER_TYPE) + : OUString(CMIS_FILE_TYPE); + } + catch (const uno::RuntimeException&) + { + throw; + } + catch (const uno::Exception& e) + { + uno::Any a(cppu::getCaughtException()); + throw lang::WrappedTargetRuntimeException( + "wrapped Exception " + e.Message, + uno::Reference<uno::XInterface>(), a); + } + return sRet; } uno::Any SAL_CALL Content::execute( |