[Libreoffice-commits] core.git: ucb/source

Thorsten Behrens Thorsten.Behrens at CIB.de
Sun Dec 11 02:43:35 UTC 2016


 ucb/source/ucp/cmis/cmis_content.cxx |   26 +++++++++++++++++++++++---
 1 file changed, 23 insertions(+), 3 deletions(-)

New commits:
commit 5e6c7d6d26349139ff5881a67c7fec3f48df6aa3
Author: Thorsten Behrens <Thorsten.Behrens at CIB.de>
Date:   Fri Dec 9 02:00:49 2016 +0100

    cmis: add error handling on checkin
    
    Change-Id: I3951a237789ee4b7697f70bc527ffbb6a626206a
    Reviewed-on: https://gerrit.libreoffice.org/31776
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

diff --git a/ucb/source/ucp/cmis/cmis_content.cxx b/ucb/source/ucp/cmis/cmis_content.cxx
index 05de9807..65ba37d 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 );


More information about the Libreoffice-commits mailing list