Improve errors for lock state

Signed-off-by: AnErrupTion <anerruption@disroot.org>
This commit is contained in:
AnErrupTion 2026-05-16 10:33:06 +02:00
parent 78794b3e10
commit 05c1d4bece
No known key found for this signature in database
1 changed files with 12 additions and 3 deletions

View File

@ -1788,7 +1788,7 @@ fn updateNumlock(self: *Label, ptr: *anyopaque) !void {
try state.log_file.err(
state.io,
"sys",
"failed to get lock state: {s}",
"failed to get lock state for numlock: {s}",
.{@errorName(err)},
);
return;
@ -1802,8 +1802,17 @@ fn updateCapslock(self: *Label, ptr: *anyopaque) !void {
const lock_state = interop.getLockState() catch |err| {
self.update_fn = null;
try state.info_line.addMessage(state.lang.err_lock_state, state.config.error_bg, state.config.error_fg);
try state.log_file.err(state.io, "sys", "failed to get lock state: {s}", .{@errorName(err)});
try state.info_line.addMessage(
state.lang.err_lock_state,
state.config.error_bg,
state.config.error_fg,
);
try state.log_file.err(
state.io,
"sys",
"failed to get lock state for capslock: {s}",
.{@errorName(err)},
);
return;
};