ErrorInfo.cpp revision 10a17670b96a3e6ddaa9ffe524882f600bd41259
/** @file
*
* ErrorInfo class definition
*/
/*
* Copyright (C) 2006-2007 innotek GmbH
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License as published by the Free Software Foundation,
* in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
* distribution. VirtualBox OSE is distributed in the hope that it will
* be useful, but WITHOUT ANY WARRANTY of any kind.
*/
#if !defined (VBOX_WITH_XPCOM)
#else
#include <nsIServiceManager.h>
#include <nsIExceptionService.h>
#include <nsCOMPtr.h>
#endif
#include "VBox/com/VirtualBox.h"
#include "VBox/com/ErrorInfo.h"
namespace com
{
// ErrorInfo class
////////////////////////////////////////////////////////////////////////////////
{
#if !defined (VBOX_WITH_XPCOM)
{
if (aKeepObj)
mErrorInfo = err;
if (!mIsFullAvailable)
{
bool gotSomething = false;
if (gotSomething)
mIsBasicAvailable = true;
}
}
#else // !defined (VBOX_WITH_XPCOM)
if (NS_SUCCEEDED (rc))
{
if (NS_SUCCEEDED (rc))
{
{
if (aKeepObj)
mErrorInfo = ex;
if (!mIsFullAvailable)
{
bool gotSomething = false;
if (NS_SUCCEEDED (rc))
if (gotSomething)
mIsBasicAvailable = true;
}
// set the exception to NULL (to emulate Win32 behavior)
}
}
}
AssertComRC (rc);
#endif // !defined (VBOX_WITH_XPCOM)
}
{
if (!aI)
return;
#if !defined (VBOX_WITH_XPCOM)
{
}
#else
#endif
if (mIsBasicAvailable)
{
mCalleeIID = aIID;
}
}
{
bool gotSomething = false;
bool gotAll = true;
{
rc = E_OUTOFMEMORY;
}
else
}
{
}
{
aPrefix = "";
if (mIsFullAvailable || mIsBasicAvailable)
{
}
}
/**
* Sets the given error info object for the current thread. If @a aPreserve
* is @c true, then the current error info set on the thread before this
* method is called will be preserved in the IVirtualBoxErrorInfo::next
* attribute of the new error info object that will be then set as the
* current error info object.
*/
//static
// ProgressErrorInfo class
////////////////////////////////////////////////////////////////////////////////
ErrorInfo (false /* aDummy */)
{
if (!progress)
return;
}
// ErrorInfoKeeper class
////////////////////////////////////////////////////////////////////////////////
{
if (mForgot)
return S_OK;
#if !defined (VBOX_WITH_XPCOM)
if (!mErrorInfo.isNull())
{
AssertComRC (rc);
}
#else // !defined (VBOX_WITH_XPCOM)
if (NS_SUCCEEDED (rc))
{
if (NS_SUCCEEDED (rc))
{
if (!mErrorInfo.isNull())
{
AssertComRC (rc);
}
}
}
#endif // !defined (VBOX_WITH_XPCOM)
{
mForgot = true;
}
return rc;
}
} /* namespace com */