diff options
author | khushishikhu <dpskhu13108@gmail.com> | 2023-10-16 00:59:32 +0530 |
---|---|---|
committer | Hossein <hossein@libreoffice.org> | 2023-10-19 13:13:38 +0200 |
commit | baf677e2f1130205df6e4a5cf0a94f4d9dc228a5 (patch) | |
tree | 57126396830cc0a42d57d13a8bdc8a4543839e96 /unoxml | |
parent | c12df614adde52cc558cf3503469efffea02dd5c (diff) |
tdf#42982: Improve UNO API error reporting
Change-Id: I16bd4bb935d02ff03422cb48d21a63e3d994d0b4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157993
Tested-by: Jenkins
Reviewed-by: Hossein <hossein@libreoffice.org>
Diffstat (limited to 'unoxml')
-rw-r--r-- | unoxml/source/xpath/xpathapi.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/unoxml/source/xpath/xpathapi.cxx b/unoxml/source/xpath/xpathapi.cxx index 17b28027534c..a60083983882 100644 --- a/unoxml/source/xpath/xpathapi.cxx +++ b/unoxml/source/xpath/xpathapi.cxx @@ -110,7 +110,7 @@ namespace XPath nsmap_t & rNamespaces, Reference< XNode > const& xNamespaceNode) { DOM::CNode *const pCNode(dynamic_cast<DOM::CNode*>(xNamespaceNode.get())); - if (!pCNode) { throw RuntimeException(); } + if (!pCNode) { throw RuntimeException("Could not use the namespace node in order to collect namespace declarations."); } ::osl::MutexGuard const g(pCNode->GetOwnerDocument().GetMutex()); @@ -274,7 +274,7 @@ namespace XPath Reference< XNode > const& xContextNode, const OUString& expr) { - if (!xContextNode.is()) { throw RuntimeException(); } + if (!xContextNode.is()) { throw RuntimeException("xContextNode does not exist!"); } nsmap_t nsmap; extensions_t extensions; @@ -288,15 +288,15 @@ namespace XPath // get the node and document ::rtl::Reference<DOM::CDocument> const pCDoc( dynamic_cast<DOM::CDocument*>(xContextNode->getOwnerDocument().get())); - if (!pCDoc.is()) { throw RuntimeException(); } + if (!pCDoc.is()) { throw RuntimeException("Interface pointer for the owner document of the xContextNode does not exist."); } DOM::CNode *const pCNode = dynamic_cast<DOM::CNode*>(xContextNode.get()); - if (!pCNode) { throw RuntimeException(); } + if (!pCNode) { throw RuntimeException("xContextNode interface pointer does not exist."); } ::osl::MutexGuard const g(pCDoc->GetMutex()); // lock the document! xmlNodePtr const pNode = pCNode->GetNodePtr(); - if (!pNode) { throw RuntimeException(); } + if (!pNode) { throw RuntimeException("Node pointer for xContextNode does not exist."); } xmlDocPtr pDoc = pNode->doc; /* NB: workaround for #i87252#: @@ -376,7 +376,7 @@ namespace XPath Reference< XXPathExtension> const& xExtension) { if (!xExtension.is()) { - throw RuntimeException(); + throw RuntimeException("Extension instance xExtension to be used by XPath does not exist."); } std::scoped_lock const g(m_Mutex); m_extensions.push_back( xExtension ); |