From d2bdb85dc81af39bc04cb50be11537c4bc1e1e19 Mon Sep 17 00:00:00 2001 From: Silent Date: Tue, 24 Jan 2023 21:56:22 +0100 Subject: [PATCH] SaveState: Add a distinct error message when the file doesn't exist It doesn't make sense to say that the file is not a valid archive, because it doesn't exist in the first place. --- pcsx2/SaveState.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/pcsx2/SaveState.cpp b/pcsx2/SaveState.cpp index 9517dfc285..25e4c123a0 100644 --- a/pcsx2/SaveState.cpp +++ b/pcsx2/SaveState.cpp @@ -1059,9 +1059,18 @@ void SaveState_UnzipFromDisk(const std::string& filename) if (!zf) { Console.Error("Failed to open zip file '%s' for save state load: %s", filename.c_str(), zip_error_strerror(&ze)); - throw Exception::SaveStateLoadError(filename) - .SetDiagMsg("Savestate file is not a valid gzip archive.") - .SetUserMsg("This savestate cannot be loaded because it is not a valid gzip archive. It may have been created by an older unsupported version of PCSX2, or it may be corrupted."); + if (zip_error_code_zip(&ze) == ZIP_ER_NOENT) + { + throw Exception::SaveStateLoadError(filename) + .SetDiagMsg("Savestate file does not exist.") + .SetUserMsg("This savestate cannot be loaded because the file does not exist."); + } + else + { + throw Exception::SaveStateLoadError(filename) + .SetDiagMsg("Savestate file is not a valid gzip archive.") + .SetUserMsg("This savestate cannot be loaded because it is not a valid gzip archive. It may have been created by an older unsupported version of PCSX2, or it may be corrupted."); + } } // look for version and screenshot information in the zip stream: