VirtualBox

Changeset 18813 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Apr 7, 2009 12:28:57 PM (16 years ago)
Author:
vboxsync
Message:

Main/IMedium,IHardDisk: fix error handling so that VBOX_E_FILE_ERROR is returned when the image is not present.

Location:
trunk/src/VBox/Main
Files:
2 edited

Legend:

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

    r18485 r18813  
    28542854
    28552855            if (RT_FAILURE (vrc))
    2856                 return setError (VBOX_E_IPRT_ERROR,
    2857                     tr ("Could not get the storage format of the hard disk "
    2858                         "'%s' (%Rrc)"), locationFull.raw(), vrc);
     2856            {
     2857                if (vrc == VERR_FILE_NOT_FOUND || vrc == VERR_PATH_NOT_FOUND)
     2858                    return setError (VBOX_E_FILE_ERROR,
     2859                        tr ("Could not find file for the hard disk "
     2860                            "'%s' (%Rrc)"), locationFull.raw(), vrc);
     2861                else
     2862                    return setError (VBOX_E_IPRT_ERROR,
     2863                        tr ("Could not get the storage format of the hard disk "
     2864                            "'%s' (%Rrc)"), locationFull.raw(), vrc);
     2865            }
    28592866
    28602867            ComAssertRet (backendName != NULL && *backendName != '\0', E_FAIL);
  • trunk/src/VBox/Main/MediumImpl.cpp

    r18313 r18813  
    969969         * newly opened media so convert this into an error */
    970970        if (!m.lastAccessError.isNull())
    971             rc = setError (E_FAIL, Utf8Str (m.lastAccessError));
     971            rc = setError (VBOX_E_FILE_ERROR, Utf8Str (m.lastAccessError));
    972972    }
    973973
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