mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Show exception message in profile saving
This commit is contained in:
parent
ed2036432b
commit
bc524cd0e9
2 changed files with 7 additions and 1 deletions
|
|
@ -13,6 +13,7 @@
|
|||
#include <algorithm>
|
||||
#include <cstdint>
|
||||
#include <cstddef>
|
||||
#include <exception>
|
||||
#include <filesystem>
|
||||
|
||||
#include <fmt/format.h>
|
||||
|
|
@ -304,7 +305,7 @@ void srb2::save_ng_gamedata()
|
|||
srb2::io::write_exact(file, tcb::as_bytes(tcb::make_span(ubjson)));
|
||||
file.close();
|
||||
}
|
||||
catch (const srb2::io::FileStreamException& ex)
|
||||
catch (const std::exception& ex)
|
||||
{
|
||||
CONS_Alert(CONS_ERROR, "NG Gamedata save failed: %s\n", ex.what());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@
|
|||
/// \brief implements methods for profiles etc.
|
||||
|
||||
#include <algorithm>
|
||||
#include <exception>
|
||||
|
||||
#include <fmt/format.h>
|
||||
|
||||
|
|
@ -332,6 +333,10 @@ void PR_SaveProfiles(void)
|
|||
|
||||
fs::rename(tmppath, realpath);
|
||||
}
|
||||
catch (const std::exception& ex)
|
||||
{
|
||||
I_Error("Couldn't save profiles. Are you out of Disk space / playing in a protected folder?\n\nException: %s", ex.what());
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
I_Error("Couldn't save profiles. Are you out of Disk space / playing in a protected folder?");
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue