summaryrefslogtreecommitdiff
path: root/src/VBox/Main/src-all/VirtualBoxBase.cpp
diff options
context:
space:
mode:
authorvboxsync <vboxsync@cfe28804-0f27-0410-a406-dd0f0b0b656f>2011-03-28 19:40:52 +0000
committervboxsync <vboxsync@cfe28804-0f27-0410-a406-dd0f0b0b656f>2011-03-28 19:40:52 +0000
commitcac8ee5d22e7b6ce819432284532bb24c822c2af (patch)
tree4a686b88fe362b3527ff0140f4b5b0439ffe15a9 /src/VBox/Main/src-all/VirtualBoxBase.cpp
parentf3d0b0dd9be6d5a0740bbc697a579d0a7ecd26f2 (diff)
downloadVirtualBox-svn-cac8ee5d22e7b6ce819432284532bb24c822c2af.tar.gz
introduced VirtualBoxBase::clearError to clear the previous error info if MultiResult is used
git-svn-id: https://www.virtualbox.org/svn/vbox/trunk@36451 cfe28804-0f27-0410-a406-dd0f0b0b656f
Diffstat (limited to 'src/VBox/Main/src-all/VirtualBoxBase.cpp')
-rw-r--r--src/VBox/Main/src-all/VirtualBoxBase.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/VBox/Main/src-all/VirtualBoxBase.cpp b/src/VBox/Main/src-all/VirtualBoxBase.cpp
index 2b9801cbaaa..99218807e6f 100644
--- a/src/VBox/Main/src-all/VirtualBoxBase.cpp
+++ b/src/VBox/Main/src-all/VirtualBoxBase.cpp
@@ -509,6 +509,29 @@ HRESULT VirtualBoxBase::setErrorNoLog(HRESULT aResultCode, const char *pcsz, ...
return rc;
}
+/**
+ * Clear the current error information.
+ */
+/*static*/
+void VirtualBoxBase::clearError(void)
+{
+#if !defined(VBOX_WITH_XPCOM)
+ ::SetErrorInfo (0, NULL);
+#else
+ HRESULT rc = S_OK;
+ nsCOMPtr <nsIExceptionService> es;
+ es = do_GetService(NS_EXCEPTIONSERVICE_CONTRACTID, &rc);
+ if (NS_SUCCEEDED(rc))
+ {
+ nsCOMPtr <nsIExceptionManager> em;
+ rc = es->GetCurrentExceptionManager (getter_AddRefs (em));
+ if (SUCCEEDED(rc))
+ em->SetCurrentException(NULL);
+ }
+#endif
+}
+
+
////////////////////////////////////////////////////////////////////////////////
//
// AutoInitSpan methods