diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-07-18 20:53:23 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-07-19 21:26:01 +0100 |
commit | c3beba871b50c058d6eba74b1e3f605f5507016d (patch) | |
tree | f7ca398abe61b461d9424d6ef1d1c321e3de8fe0 /desktop | |
parent | 6d28e240f0f3400fa2729afa3cae54da61f5a34c (diff) |
coverity#706501 Uncaught exception
Change-Id: I435d189e6194d8d255ec88c4edad73d19a9bb5be
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/source/deployment/registry/package/dp_package.cxx | 36 |
1 files changed, 25 insertions, 11 deletions
diff --git a/desktop/source/deployment/registry/package/dp_package.cxx b/desktop/source/deployment/registry/package/dp_package.cxx index 636b81a5dcf9..b8501b7c3d5b 100644 --- a/desktop/source/deployment/registry/package/dp_package.cxx +++ b/desktop/source/deployment/registry/package/dp_package.cxx @@ -1188,20 +1188,34 @@ void BackendImpl::PackageImpl::exportTo( } else { - // overwrite manifest.xml: - ::ucbhelper::Content manifestContent; - if ( ! create_ucb_content( - &manifestContent, - makeURL( m_url_expanded, "META-INF/manifest.xml" ), - xCmdEnv, false ) ) + bool bSuccess = false; + try + { + // overwrite manifest.xml: + ::ucbhelper::Content manifestContent; + if ( ! create_ucb_content( + &manifestContent, + makeURL( m_url_expanded, "META-INF/manifest.xml" ), + xCmdEnv, false ) ) + { + OSL_FAIL( "### missing META-INF/manifest.xml file!" ); + return; + } + + if (metainfFolderContent.transferContent( + manifestContent, ::ucbhelper::InsertOperation_COPY, + OUString(), ucb::NameClash::OVERWRITE )) + { + bSuccess = true; + } + } + catch (const css::ucb::ContentCreationException &e) { - OSL_FAIL( "### missing META-INF/manifest.xml file!" ); - return; + SAL_WARN( + "desktop.deployment", "exception on overwriting manifest: " << e.Message); } - if (! metainfFolderContent.transferContent( - manifestContent, ::ucbhelper::InsertOperation_COPY, - OUString(), ucb::NameClash::OVERWRITE )) + if (!bSuccess) throw RuntimeException( "UCB transferContent() failed!", static_cast<OWeakObject *>(this) ); } |