diff --git a/src/g_gamedata.cpp b/src/g_gamedata.cpp index e4a2b6b7a..14ad25d1a 100644 --- a/src/g_gamedata.cpp +++ b/src/g_gamedata.cpp @@ -434,6 +434,13 @@ void srb2::load_ng_gamedata() json parsed = json::from_ubjson(remainder_as_u8); js = parsed.template get(); } + catch (const std::exception& ex) + { + const char* gdfolder = G_GameDataFolder(); + const char* what = ex.what(); + I_Error("Game data is corrupt.\nDelete %s (maybe in %s) and try again.\n\nException: %s", gamedatafilename, gdfolder, what); + return; + } catch (...) { const char* gdfolder = G_GameDataFolder(); diff --git a/src/k_profiles.cpp b/src/k_profiles.cpp index eb5371f98..1d8a9a8f8 100644 --- a/src/k_profiles.cpp +++ b/src/k_profiles.cpp @@ -398,9 +398,14 @@ void PR_LoadProfiles(void) json parsed = json::from_ubjson(remainder_as_u8); js = parsed.template get(); } + catch (const std::exception& ex) + { + I_Error("Profiles file is corrupt.\n\nException: %s", ex.what()); + return; + } catch (...) { - I_Error("Profiles file is corrupt"); + I_Error("Profiles file is corrupt."); return; }