sfx2/source/doc/objserv.cxx | 6 +++--- sfx2/source/doc/sfxbasemodel.cxx | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-)
New commits: commit 2c213582376216eacb613e576314e0b9cba0aa04 Author: Mike Kaganski <mike.kagan...@collabora.com> AuthorDate: Fri Oct 13 12:41:25 2023 +0300 Commit: Mike Kaganski <mike.kagan...@collabora.com> CommitDate: Sat Oct 14 17:36:30 2023 +0200 Keep some information when switching between exceptions and ErrCodeMsg This simplifies debugging. Change-Id: I21ba175a039bed9a1f13d510b2c80eb6356417ea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157908 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx index 7dddb84e5fac..fb62f3768163 100644 --- a/sfx2/source/doc/objserv.cxx +++ b/sfx2/source/doc/objserv.cxx @@ -1109,11 +1109,11 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq) catch( const task::ErrorCodeIOException& aErrorEx ) { TOOLS_WARN_EXCEPTION_IF(ErrCode(aErrorEx.ErrCode) != ERRCODE_IO_ABORT, "sfx.doc", "Fatal IO error during save"); - nErrorCode = ErrCode(aErrorEx.ErrCode); + nErrorCode = { ErrCode(aErrorEx.ErrCode), aErrorEx.Message }; } - catch( Exception& ) + catch( Exception& e ) { - nErrorCode = ERRCODE_IO_GENERAL; + nErrorCode = { ERRCODE_IO_GENERAL, e.Message }; } // by default versions should be preserved always except in case of an explicit diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index f4b1f8305588..99901fdac73f 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -1697,8 +1697,7 @@ void SAL_CALL SfxBaseModel::storeSelf( const Sequence< beans::PropertyValue > pParams.reset(); - ErrCodeMsg nErrCode = m_pData->m_pObjectShell->GetErrorIgnoreWarning() ? m_pData->m_pObjectShell->GetErrorIgnoreWarning() - : ERRCODE_IO_CANTWRITE; + ErrCodeMsg nErrCode = m_pData->m_pObjectShell->GetErrorIgnoreWarning(); m_pData->m_pObjectShell->ResetError(); if ( bRet ) @@ -1709,6 +1708,8 @@ void SAL_CALL SfxBaseModel::storeSelf( const Sequence< beans::PropertyValue > } else { + if (!nErrCode) + nErrCode = ERRCODE_IO_CANTWRITE; // write the contents of the logger to the file SfxGetpApp()->NotifyEvent( SfxEventHint( SfxEventHintId::SaveDocFailed, GlobalEventConfig::GetEventName(GlobalEventId::SAVEDOCFAILED), m_pData->m_pObjectShell.get() ) );