summaryrefslogtreecommitdiff
path: root/ucb
diff options
context:
space:
mode:
authorThorsten Behrens <Thorsten.Behrens@CIB.de>2016-12-09 02:00:49 +0100
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2016-12-11 02:42:57 +0000
commit5e6c7d6d26349139ff5881a67c7fec3f48df6aa3 (patch)
tree9abfab52534865ae4f6ba07a551e182c67bda0c6 /ucb
parent1188061c25cb5aaa32193a78111fcbe2ef10eaf1 (diff)
cmis: add error handling on checkin
Change-Id: I3951a237789ee4b7697f70bc527ffbb6a626206a Reviewed-on: https://gerrit.libreoffice.org/31776 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'ucb')
-rw-r--r--ucb/source/ucp/cmis/cmis_content.cxx26
1 files changed, 23 insertions, 3 deletions
diff --git a/ucb/source/ucp/cmis/cmis_content.cxx b/ucb/source/ucp/cmis/cmis_content.cxx
index 05de98078935..65ba37d484fd 100644
--- a/ucb/source/ucp/cmis/cmis_content.cxx
+++ b/ucb/source/ucp/cmis/cmis_content.cxx
@@ -1052,8 +1052,14 @@ namespace cmis
{
object = getObject( xEnv );
}
- catch ( const libcmis::Exception& )
+ catch ( const libcmis::Exception& e )
{
+ SAL_INFO( "ucb.ucp.cmis", "Unexpected libcmis exception: " << e.what( ) );
+ ucbhelper::cancelCommandExecution(
+ ucb::IOErrorCode_GENERAL,
+ uno::Sequence< uno::Any >( 0 ),
+ xEnv,
+ OUString::createFromAscii( e.what() ) );
}
libcmis::Document* pPwc = dynamic_cast< libcmis::Document* >( object.get( ) );
@@ -1071,8 +1077,22 @@ namespace cmis
copyData( xIn, xOutput );
map< string, libcmis::PropertyPtr > newProperties;
- libcmis::DocumentPtr pDoc = pPwc->checkIn( rArg.MajorVersion, OUSTR_TO_STDSTR( rArg.VersionComment ), newProperties,
- pOut, OUSTR_TO_STDSTR( rArg.MimeType ), OUSTR_TO_STDSTR( rArg.NewTitle ) );
+ libcmis::DocumentPtr pDoc;
+
+ try
+ {
+ pDoc = pPwc->checkIn( rArg.MajorVersion, OUSTR_TO_STDSTR( rArg.VersionComment ), newProperties,
+ pOut, OUSTR_TO_STDSTR( rArg.MimeType ), OUSTR_TO_STDSTR( rArg.NewTitle ) );
+ }
+ catch ( const libcmis::Exception& e )
+ {
+ SAL_INFO( "ucb.ucp.cmis", "Unexpected libcmis exception: " << e.what( ) );
+ ucbhelper::cancelCommandExecution(
+ ucb::IOErrorCode_GENERAL,
+ uno::Sequence< uno::Any >( 0 ),
+ xEnv,
+ OUString::createFromAscii( e.what() ) );
+ }
// Get the URL and send it back as a result
URL aCmisUrl( m_sURL );