Kaydet (Commit) 5e6c7d6d authored tarafından Thorsten Behrens's avatar Thorsten Behrens

cmis: add error handling on checkin

Change-Id: I3951a237789ee4b7697f70bc527ffbb6a626206a
Reviewed-on: https://gerrit.libreoffice.org/31776Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarThorsten Behrens <Thorsten.Behrens@CIB.de>
üst 1188061c
......@@ -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,
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 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment