VirtualBox

Changeset 14858 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Dec 1, 2008 1:56:37 PM (16 years ago)
Author:
vboxsync
Message:

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

  • IVirtualBox::createMachine
  • IVirtualBox::createLegacyMachine
  • IVirtualBox::openMachine
  • IVirtualBox::registerMachine
  • IVirtualBox::getMachine
  • IVirtualBox::findMachine
  • IVirtualBox::unregisterMachine
Location:
trunk/src/VBox/Main
Files:
3 edited

Legend:

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

    r14854 r14858  
    41594159    {
    41604160        if (mData->mRegistered)
    4161             return setError (E_FAIL,
     4161            return setError (VBOX_E_INVALID_OBJECT_STATE,
    41624162                tr ("The machine '%ls' with UUID {%s} is already registered"),
    41634163                mUserData->mName.raw(),
     
    41674167    {
    41684168        if (mData->mMachineState == MachineState_Saved)
    4169             return setError (E_FAIL,
     4169            return setError (VBOX_E_INVALID_VM_STATE,
    41704170                tr ("Cannot unregister the machine '%ls' because it "
    41714171                    "is in the Saved state"),
     
    41764176            snapshotCount = mData->mFirstSnapshot->descendantCount() + 1;
    41774177        if (snapshotCount)
    4178             return setError (E_FAIL,
     4178            return setError (VBOX_E_INVALID_OBJECT_STATE,
    41794179                tr ("Cannot unregister the machine '%ls' because it "
    41804180                    "has %d snapshots"),
     
    41824182
    41834183        if (mData->mSession.mState != SessionState_Closed)
    4184             return setError (E_FAIL,
     4184            return setError (VBOX_E_INVALID_OBJECT_STATE,
    41854185                tr ("Cannot unregister the machine '%ls' because it has an "
    41864186                    "open session"),
     
    41884188
    41894189        if (mHDData->mAttachments.size() != 0)
    4190             return setError (E_FAIL,
     4190            return setError (VBOX_E_INVALID_OBJECT_STATE,
    41914191                tr ("Cannot unregister the machine '%ls' because it "
    41924192                    "has %d hard disks attached"),
  • trunk/src/VBox/Main/VirtualBoxImpl.cpp

    r14854 r14858  
    962962         *  or opened by OpenMachine() or loaded during startup
    963963         */
    964         return setError (E_FAIL,
     964        return setError (VBOX_E_INVALID_OBJECT_STATE,
    965965            tr ("The machine named '%ls' is not created within this "
    966966                "VirtualBox instance"), name.raw());
     
    10411041    HRESULT rc = machine
    10421042        ? S_OK
    1043         : setError (E_INVALIDARG,
     1043        : setError (VBOX_E_FILE_ERROR,
    10441044            tr ("Could not find a registered machine named '%ls'"), aName);
    10451045
     
    26352635    if (aSetError && !found)
    26362636    {
    2637         setError (E_INVALIDARG,
     2637        setError (VBOX_E_FILE_ERROR,
    26382638            tr ("Could not find a registered machine with UUID {%RTuuid}"),
    26392639            aId.raw());
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r14849 r14858  
    14841484
    14851485        @deprecated Will be removed soon.
     1486        <result name="VBOX_E_FILE_ERROR">
     1487          Settings file name invalid, not found or sharing violation.
     1488        </result>
    14861489      </desc>
    14871490      <param name="settingsFile" type="wstring" dir="in">
     
    15151518        </note>
    15161519
     1520        <result name="VBOX_E_INVALID_OBJECT_STATE">
     1521          Virtual machine was not created within this VirtualBox instance.
     1522        </result>
     1523
    15171524      </desc>
    15181525      <param name="machine" type="IMachine" dir="in"/>
     
    15221529      <desc>
    15231530        Attempts to find a virtual machine given its UUID.
    1524         To look up a machine by name, use <link to="IVirtualBox::findMachine" /> instead.
     1531        To look up a machine by name, use <link to="IVirtualBox::findMachine" />
     1532        instead.
     1533
     1534        <result name="VBOX_E_FILE_ERROR">
     1535          Could not find registered machine matching @a id.
     1536        </result>
     1537
    15251538      </desc>
    15261539      <param name="id" type="uuid" dir="in"/>
     
    15311544      <desc>
    15321545        Attempts to find a virtual machine given its name.
    1533         To look up a machine by UUID, use <link to="IVirtualBox::getMachine" /> instead.
     1546        To look up a machine by UUID, use <link to="IVirtualBox::getMachine" />
     1547        instead.
     1548
     1549        <result name="VBOX_E_FILE_ERROR">
     1550          Could not find registered machine matching @a name.
     1551        </result>
     1552
    15341553      </desc>
    15351554      <param name="name" type="wstring" dir="in"/>
     
    15631582          <b>any</b> method will return the "Object not ready" error.
    15641583        </note>
     1584
     1585        <result name="VBOX_E_FILE_ERROR">
     1586          Could not find registered machine matching @a id.
     1587        </result>
     1588        <result name="VBOX_E_INVALID_VM_STATE">
     1589          Machine is in Saved state.
     1590        </result>
     1591        <result name="VBOX_E_INVALID_OBJECT_STATE">
     1592          Machine has snapshot or open session or hard disk attached.
     1593        </result>
    15651594
    15661595      </desc>
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