ErrorInfo.cpp revision c829b606c5535f37e00ffee381cca0815a57f319
/* $Id$ */
/** @file
*
* ErrorInfo class definition
*/
/*
* Copyright (C) 2006-2007 Sun Microsystems, Inc.
*
* 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 (GPL) 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.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
* Clara, CA 95054 USA or visit http://www.sun.com if you need
* additional information or have any questions.
*/
#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;
{
mInterfaceID = iid;
}
{
rc = E_OUTOFMEMORY;
}
else
}
{
}
// 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 */