summaryrefslogtreecommitdiff
path: root/src/config/shared/actions/ConfigActions.hpp
diff options
context:
space:
mode:
authorVaxry <43317083+vaxerski@users.noreply.github.com>2026-04-28 15:56:07 +0100
committerGitHub <noreply@github.com>2026-04-28 15:56:07 +0100
commit98fbbafef78057c818fb02b15c27e38ad2f5b5bc (patch)
treec62aa1eae704e7595d58f7edeb3804e8bfd0099d /src/config/shared/actions/ConfigActions.hpp
parentd4c6ff434c5c7aa66bc7c28e5ce336d2a694bfcc (diff)
config/errors: Report and categorize errors properly for actions (#14192)
Makes all errors categorized, some not displayed, some displayed. All errors can be obtained after hl.dispatch()
Diffstat (limited to 'src/config/shared/actions/ConfigActions.hpp')
-rw-r--r--src/config/shared/actions/ConfigActions.hpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/config/shared/actions/ConfigActions.hpp b/src/config/shared/actions/ConfigActions.hpp
index b9f54f50..0f16aff7 100644
--- a/src/config/shared/actions/ConfigActions.hpp
+++ b/src/config/shared/actions/ConfigActions.hpp
@@ -7,19 +7,29 @@
#include "../../../desktop/DesktopTypes.hpp"
#include "../../../desktop/Workspace.hpp"
#include "../../../helpers/math/Direction.hpp"
+#include "../ConfigErrors.hpp"
namespace Config::Actions {
struct SActionResult {
bool passEvent = false;
};
+ using eActionErrorLevel = Config::eConfigErrorLevel;
+ using eActionErrorCode = Config::eConfigErrorCode;
+ using SActionError = Config::SConfigError;
+ using Config::toString;
+
+ inline std::unexpected<SActionError> actionError(std::string message, eActionErrorLevel level = eActionErrorLevel::ERROR, eActionErrorCode code = eActionErrorCode::UNKNOWN) {
+ return Config::configError(std::move(message), level, code);
+ }
+
enum eTogglableAction : uint8_t {
TOGGLE_ACTION_TOGGLE = 0,
TOGGLE_ACTION_ENABLE,
TOGGLE_ACTION_DISABLE,
};
- using ActionResult = std::expected<SActionResult, std::string>;
+ using ActionResult = std::expected<SActionResult, SActionError>;
ActionResult closeWindow(std::optional<PHLWINDOW> window = std::nullopt /* Active */);
ActionResult killWindow(std::optional<PHLWINDOW> window = std::nullopt /* Active */);