VirtualBox

Changeset 91430 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Sep 28, 2021 11:24:48 AM (3 years ago)
Author:
vboxsync
Message:

Main/Console: Improve error message handling when a VM fails to
powerUp() due to a missing saved state file (don't advise user to delete
it).

File:
1 edited

Legend:

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

    r91363 r91430  
    77287728            int vrc = SSMR3ValidateFile(Utf8Str(savedStateFile).c_str(), false /* fChecksumIt */);
    77297729            if (RT_FAILURE(vrc))
    7730                 throw setErrorBoth(VBOX_E_FILE_ERROR, vrc,
    7731                                    tr("VM cannot start because the saved state file '%ls' is invalid (%Rrc). Delete the saved state prior to starting the VM"),
    7732                                    savedStateFile.raw(), vrc);
     7730            {
     7731                Utf8Str errMsg;
     7732                switch (vrc)
     7733                {
     7734                    case VERR_FILE_NOT_FOUND:
     7735                        errMsg = Utf8StrFmt(tr("VM failed to start because the saved state file '%ls' does not exist."),
     7736                                               savedStateFile.raw());
     7737                        break;
     7738                    default:
     7739                        errMsg = Utf8StrFmt(tr("VM failed to start because the saved state file '%ls' is invalid (%Rrc). "
     7740                                               "Delete the saved state prior to starting the VM."), savedStateFile.raw(), vrc);
     7741                        break;
     7742                }
     7743                throw setErrorBoth(VBOX_E_FILE_ERROR, vrc, errMsg.c_str());
     7744            }
    77337745        }
    77347746
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