From 98fbbafef78057c818fb02b15c27e38ad2f5b5bc Mon Sep 17 00:00:00 2001 From: Vaxry <43317083+vaxerski@users.noreply.github.com> Date: Tue, 28 Apr 2026 15:56:07 +0100 Subject: 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() --- src/debug/HyprCtl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/debug/HyprCtl.cpp') diff --git a/src/debug/HyprCtl.cpp b/src/debug/HyprCtl.cpp index bb575ce5..540a28e2 100644 --- a/src/debug/HyprCtl.cpp +++ b/src/debug/HyprCtl.cpp @@ -1258,7 +1258,7 @@ static std::string evalRequest(eHyprCtlOutputFormat format, std::string request) auto err = luaMgr->eval(code); if (err) - return std::format("error: {}", *err); + return *err; return "ok"; } @@ -1269,7 +1269,7 @@ static std::string dispatchRequest(eHyprCtlOutputFormat format, std::string in) if (Config::mgr()->type() == Config::CONFIG_LUA) { // For lua, this is just a wrapper for `eval("hl.dispatch(in)") - std::string evalStr = std::format("hl.dispatch({})", in); + std::string evalStr = std::format("return hl.dispatch({})", in); auto luaMgr = dynamicPointerCast(WP(Config::mgr())); auto ret = luaMgr->eval(evalStr).value_or("ok"); -- cgit v1.2.3