36 static std::atomic<bool> flag {
true};
50 return GetShowDialogs() && presenter && presenter->CanShowDialogs();
57 presenter->ShowError(message);
61class Error :
public std::runtime_error
68 :
Error(
code, std::string(message), showMsgBox)
73 : std::runtime_error(message)
79 static_cast<int>(
code), message);
83 explicit Error(
const char* message,
bool showMsgBox =
true)
88 explicit Error(
const std::string& message,
bool showMsgBox =
true)
Logging facade for application-wide logging.
Error(const std::string &message, bool showMsgBox=true)
Definition Error.hpp:88
Error(const char *message, bool showMsgBox=true)
Definition Error.hpp:83
ErrorCode code() const
Definition Error.hpp:93
ErrorCode m_code
Definition Error.hpp:64
Error(ErrorCode code, const char *message, bool showMsgBox=true)
Definition Error.hpp:67
Error(ErrorCode code, const std::string &message, bool showMsgBox=true)
Definition Error.hpp:72
static UiServices & Instance()
Definition UiServices.hpp:16
std::shared_ptr< IErrorPresenter > GetErrorPresenter() const
Definition UiServices.hpp:35
static void Error(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logger.hpp:303
bool GetShowDialogs()
Definition Error.hpp:43
bool CanShowDialogs()
Definition Error.hpp:47
void ShowError(std::string_view message)
Definition Error.hpp:53
std::atomic< bool > & DialogsEnabledFlag()
Definition Error.hpp:34
ErrorCode
Error code enumeration for categorizing errors.
Definition Error.hpp:23
@ InvalidArgument
Invalid argument provided.
@ FileNotFound
File not found.
@ IOError
Input/output error.
@ Unknown
Unknown or unspecified error.
@ NotImplemented
Feature not yet implemented.
@ RuntimeError
Runtime error occurred.
@ ParseError
Parsing error.
void SetShowDialogs(bool enabled)
Definition Error.hpp:39