diff --git a/src/openrct2/ParkImporter.h b/src/openrct2/ParkImporter.h index ca9b00e977..ef7fa97080 100644 --- a/src/openrct2/ParkImporter.h +++ b/src/openrct2/ParkImporter.h @@ -81,6 +81,11 @@ public: : MissingObjects(std::move(missingObjects)) { } + + const char* what() const noexcept override + { + return "Missing objects"; + } }; class UnsupportedRideTypeException : public std::exception @@ -92,6 +97,11 @@ public: : Type(type) { } + + const char* what() const noexcept override + { + return "Invalid ride type"; + } }; class UnsupportedVersionException : public std::exception @@ -105,4 +115,9 @@ public: , TargetVersion(targetVersion) { } + + const char* what() const noexcept override + { + return "Unexpected version"; + } }; diff --git a/src/openrct2/network/ServerList.cpp b/src/openrct2/network/ServerList.cpp index 7630b2d3b2..5ee748bad0 100644 --- a/src/openrct2/network/ServerList.cpp +++ b/src/openrct2/network/ServerList.cpp @@ -23,6 +23,7 @@ # include "../core/Memory.hpp" # include "../core/Path.hpp" # include "../core/String.hpp" +# include "../localisation/Language.h" # include "../platform/Platform.h" # include "Socket.h" # include "network.h" @@ -432,4 +433,10 @@ uint32_t ServerList::GetTotalPlayerCount() const }); } +const char* MasterServerException::what() const noexcept +{ + static std::string localisedStatusText = LanguageGetString(StatusText); + return localisedStatusText.c_str(); +} + #endif diff --git a/src/openrct2/network/ServerList.h b/src/openrct2/network/ServerList.h index c186e435d5..1d7af964bb 100644 --- a/src/openrct2/network/ServerList.h +++ b/src/openrct2/network/ServerList.h @@ -80,4 +80,6 @@ public: : StatusText(statusText) { } + + const char* what() const noexcept override; };