VirtualBox

Changeset 14846 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Dec 1, 2008 10:26:21 AM (16 years ago)
Author:
vboxsync
Message:

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

  • IConsole::createSharedFolder
  • IConsole::removeSharedFolder
Location:
trunk/src/VBox/Main
Files:
2 edited

Legend:

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

    r14843 r14846  
    21272127    /// @todo see @todo in AttachUSBDevice() about the Paused state
    21282128    if (mMachineState == MachineState_Saved)
    2129         return setError (E_FAIL,
     2129        return setError (VBOX_E_INVALID_VM_STATE,
    21302130            tr ("Cannot create a transient shared folder on the "
    21312131                "machine in the saved state"));
    21322132    if (mMachineState > MachineState_Paused)
    2133         return setError (E_FAIL,
     2133        return setError (VBOX_E_INVALID_VM_STATE,
    21342134            tr ("Cannot create a transient shared folder on the "
    21352135                "machine while it is changing the state (machine state: %d)"),
     
    21392139    HRESULT rc = findSharedFolder (aName, sharedFolder, false /* aSetError */);
    21402140    if (SUCCEEDED (rc))
    2141         return setError (E_FAIL,
     2141        return setError (VBOX_E_FILE_ERROR,
    21422142            tr ("Shared folder named '%ls' already exists"), aName);
    21432143
     
    21512151
    21522152    if (!accessible)
    2153         return setError (E_FAIL,
     2153        return setError (VBOX_E_FILE_ERROR,
    21542154            tr ("Shared folder host path '%ls' is not accessible"), aHostPath);
    21552155
     
    21992199    /// @todo see @todo in AttachUSBDevice() about the Paused state
    22002200    if (mMachineState == MachineState_Saved)
    2201         return setError (E_FAIL,
     2201        return setError (VBOX_E_INVALID_VM_STATE,
    22022202            tr ("Cannot remove a transient shared folder from the "
    22032203                "machine in the saved state"));
    22042204    if (mMachineState > MachineState_Paused)
    2205         return setError (E_FAIL,
     2205        return setError (VBOX_E_INVALID_VM_STATE,
    22062206            tr ("Cannot remove a transient shared folder from the "
    22072207                "machine while it is changing the state (machine state: %d)"),
     
    49744974
    49754975    if (aSetError)
    4976         setError (E_INVALIDARG,
     4976        setError (VBOX_E_FILE_ERROR,
    49774977                  tr ("Could not find a shared folder named '%ls'."), aName);
    49784978
    4979     return E_INVALIDARG;
     4979    return VBOX_E_FILE_ERROR;
    49804980}
    49814981
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r14843 r14846  
    48974897        folders and starts sharing it. Refer to the description of
    48984898        <link to="ISharedFolder"/> to read more about logical names.
     4899
     4900        <result name="VBOX_E_INVALID_VM_STATE">
     4901          Virtual machine in Saved state or currently changing state.
     4902        </result>
     4903        <result name="VBOX_E_FILE_ERROR">
     4904          Shared folder already exists or not accessible.
     4905        </result>
    48994906      </desc>
    49004907      <param name="name" type="wstring" dir="in">
     
    49144921        created by <link to="#createSharedFolder"/> from the collection of
    49154922        shared folders and stops sharing it.
     4923        <result name="VBOX_E_INVALID_VM_STATE">
     4924          Virtual machine in Saved state or currently changing state.
     4925        </result>
     4926        <result name="VBOX_E_FILE_ERROR">
     4927          Shared folder does not exists.
     4928        </result>
    49164929      </desc>
    49174930      <param name="name" type="wstring" dir="in">
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