VirtualBox

Changeset 29953 in vbox


Ignore:
Timestamp:
Jun 1, 2010 3:03:06 PM (14 years ago)
Author:
vboxsync
Message:

SessionImpl.cpp: Don't use ComAssertComRC because it's evil - it doesn't work the same way in all builds wrt error info. Also it is not nice to assert here just because some remote VM process died.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/SessionImpl.cpp

    r29853 r29953  
    181181    CHECK_OPEN();
    182182
    183     HRESULT rc = E_FAIL;
    184 
     183    HRESULT rc;
    185184    if (mConsole)
    186185        rc = mConsole->machine().queryInterfaceTo(aMachine);
    187186    else
    188187        rc = mRemoteMachine.queryInterfaceTo(aMachine);
    189     ComAssertComRC(rc);
     188    if (FAILED(rc))
     189    {
     190        /** @todo VBox 3.3: replace E_FAIL with rc here. */
     191        if (mConsole)
     192            setError(E_FAIL, tr("Failed to query the session machine (%Rhrc)"), rc);
     193        else if (FAILED_DEAD_INTERFACE(rc))
     194            setError(E_FAIL, tr("Peer process crashed"));
     195        else
     196            setError(E_FAIL, tr("Failed to query the remote session machine (%Rhrc)"), rc);
     197    }
    190198
    191199    return rc;
     
    203211    CHECK_OPEN();
    204212
    205     HRESULT rc = E_FAIL;
    206 
     213    HRESULT rc;
    207214    if (mConsole)
    208215        rc = mConsole.queryInterfaceTo(aConsole);
    209216    else
    210217        rc = mRemoteConsole.queryInterfaceTo(aConsole);
    211     ComAssertComRC(rc);
     218    if (FAILED(rc))
     219    {
     220        /** @todo VBox 3.3: replace E_FAIL with rc here. */
     221        if (mConsole)
     222            setError(E_FAIL, tr("Failed to query the console (%Rhrc)"), rc);
     223        else if (FAILED_DEAD_INTERFACE(rc))
     224            setError(E_FAIL, tr("Peer process crashed"));
     225        else
     226            setError(E_FAIL, tr("Failed to query the remote console (%Rhrc)"), rc);
     227    }
    212228
    213229    return rc;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette