diff options
Diffstat (limited to 'src/game')
-rw-r--r-- | src/game/status_manager.cpp | 9 | ||||
-rw-r--r-- | src/game/status_manager.hpp | 2 |
2 files changed, 7 insertions, 4 deletions
diff --git a/src/game/status_manager.cpp b/src/game/status_manager.cpp index e4838cc..fd56627 100644 --- a/src/game/status_manager.cpp +++ b/src/game/status_manager.cpp @@ -2,6 +2,7 @@ #include <fmt/core.h> +#include <stdexcept> #include <utility> void StatusManager::bind(const std::shared_ptr<IStatusLine> &statusline) noexcept @@ -11,12 +12,14 @@ void StatusManager::bind(const std::shared_ptr<IStatusLine> &statusline) noexcep void StatusManager::set_section_title( const StatusLineSection §ion, - const std::string_view &title) noexcept + const std::string_view &title) { if (_section_title_lengths.contains(section)) { - fmt::print(stderr, "Error: can't set statusbar section title more than once"); - return; + throw std::logic_error(fmt::format( + "Unable to set statusbar section title to '{}'. Section has already been " + "assigned a title", + title)); } _statusline->set_section_status(section, title); diff --git a/src/game/status_manager.hpp b/src/game/status_manager.hpp index c101289..b170cf9 100644 --- a/src/game/status_manager.hpp +++ b/src/game/status_manager.hpp @@ -17,7 +17,7 @@ public: void set_section_title( const StatusLineSection §ion, - const std::string_view &title) noexcept override; + const std::string_view &title) override; void set_section_body( const StatusLineSection §ion, |