VirtualBox

Changeset 14786 in vbox for trunk


Ignore:
Timestamp:
Nov 28, 2008 3:17:42 PM (16 years ago)
Author:
vboxsync
Message:

#3285: Improve error handling API to include unique error numbers
Document

  • IConsole::getPowerButtonHandled
  • IConsole::getGuestEnteredACPIMode
  • IConsole::saveState
  • IConsole::adoptSavedState
  • IConsole::discardSavedState
Location:
trunk/src/VBox/Main
Files:
2 edited

Legend:

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

    r14778 r14786  
    16301630
    16311631    HRESULT rc = VBOX_SUCCESS (vrc) ? S_OK :
    1632         setError (E_FAIL,
     1632        setError (VBOX_E_PDM_ERROR,
    16331633            tr ("Checking if the ACPI Power Button event was handled by the "
    16341634                "guest OS failed (%Rrc)"), vrc);
     
    16551655
    16561656    if (mMachineState != MachineState_Running)
    1657         return E_FAIL;
     1657        return setError (VBOX_E_INVALID_VM_STATE,
     1658            tr ("Cannot get guest ACPI mode as it is "
     1659            "not running (machine state: %d)"), mMachineState);
    16581660
    16591661    /* protect mpVM */
     
    17311733        mMachineState != MachineState_Paused)
    17321734    {
    1733         return setError (E_FAIL,
     1735        return setError (VBOX_E_INVALID_VM_STATE,
    17341736            tr ("Cannot save the execution state as the machine "
    17351737                "is not running (machine state: %d)"), mMachineState);
     
    17981800                if (VBOX_FAILURE (vrc))
    17991801                {
    1800                     rc = setError (E_FAIL,
     1802                    rc = setError (VBOX_E_FILE_ERROR,
    18011803                        tr ("Could not create a directory '%s' to save the state to (%Rrc)"),
    18021804                        dir.raw(), vrc);
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r14783 r14786  
    47194719    <method name="getPowerButtonHandled">
    47204720      <desc>Checks if the last power button event was handled by guest.
     4721        <result name="VBOX_E_PDM_ERROR">
     4722          Checking if the event was handled by the guest OS failed.
     4723        </result>
    47214724      </desc>
    47224725      <param name="handled" type="boolean" dir="return"/>
     
    47264729      <desc>Checks if the guest entered the ACPI mode G0 (working) or
    47274730        G1 (sleeping). If this method returns false, the guest will
    4728         most likely not respond to external ACPI events.</desc>
     4731        most likely not respond to external ACPI events.
     4732        <result name="VBOX_E_INVALID_VM_STATE">
     4733          Virtual machine not in Running state.
     4734        </result>
     4735      </desc>
    47294736      <param name="entered" type="boolean" dir="return"/>
    47304737    </method>
     
    47514758          settings (including runtime changes to the DVD drive, etc.).
    47524759          Together with the impossibility to change any VM settings when it is
    4753           in the Saved state, this guarantees the adequate hardware
     4760          in the Saved state, this guarantees adequate hardware
    47544761          configuration of the machine when it is restored from the saved
    47554762          state file.
     
    47604767          the operation will fail.
    47614768        </note>
     4769        <result name="VBOX_E_INVALID_VM_STATE">
     4770          Virtual machine state neither Running nor Paused.
     4771        </result>
     4772        <result name="VBOX_E_FILE_ERROR">
     4773          Failed to create directory for saved state file.
     4774        </result>
    47624775
    47634776        <see><link to="#takeSnapshot"/></see>
     
    47774790        created.
    47784791
    4779         The specified saved state file path may be full or relative to the
     4792        The specified saved state file path may be absolute or relative to the
    47804793        folder the VM normally saves the state to (usually,
    47814794        <link to="IMachine::snapshotFolder"/>).
     
    47884801          is undefined.
    47894802        </note>
     4803        <result name="VBOX_E_INVALID_VM_STATE">
     4804          Virtual machine state neither PoweredOff nor Aborted.
     4805        </result>
    47904806      </desc>
    47914807      <param name="savedStateFile" type="wstring" dir="in">
     
    48034819          the machine without doing a proper shutdown in the guest OS.
    48044820        </note>
     4821        <result name="VBOX_E_INVALID_VM_STATE">
     4822          Virtual machine not in state Saved.
     4823        </result>
    48054824      </desc>
    48064825    </method>
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