summaryrefslogtreecommitdiff
path: root/svtools/source
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2023-09-28 15:15:53 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2023-09-28 16:02:55 +0200
commit11aa86140eaac3d1d67db1f337fc1c76a511778f (patch)
tree7809cae938a1dfb247c112216e2e45fcdbec9da0 /svtools/source
parent608c35665bee5990bd7e2799854e233d1454b6a4 (diff)
Improve OleRun error reporting
1. Pass its error message up the call stack as the exception's message. 2. In case of REGDB_E_CLASSNOTREG, also obtain the object's class name and append it to the message. 3. Show this information in the message displayed for OLE activation error. This introduces a new SetExtendedMessage method in SfxErrorContext to store extra information for specific errors. Change-Id: Id3863276266d992ae407fbfa5568acf5c57aa96f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157372 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'svtools/source')
-rw-r--r--svtools/source/misc/ehdl.cxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/svtools/source/misc/ehdl.cxx b/svtools/source/misc/ehdl.cxx
index a2cd3ef63323..ef35b3975fca 100644
--- a/svtools/source/misc/ehdl.cxx
+++ b/svtools/source/misc/ehdl.cxx
@@ -293,7 +293,19 @@ bool SfxErrorContext::GetString(ErrCode nErrId, OUString &rStr)
}
}
+ if (bRet)
+ if (auto it = m_extMessages.find(sal_uInt32(nErrId)); it != m_extMessages.end())
+ rStr += "\n" + it->second;
+
return bRet;
}
+void SfxErrorContext::SetExtendedMessage(ErrCode nErrId, const OUString& rStr)
+{
+ if (rStr.isEmpty())
+ m_extMessages.erase(sal_uInt32(nErrId));
+ else
+ m_extMessages[sal_uInt32(nErrId)] = rStr;
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */