fix: log before stopping watch thread on handler error

This commit is contained in:
CJ van den Berg 2026-03-14 23:51:11 +01:00
parent 1574e4b446
commit 2e1f469e3e
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
3 changed files with 36 additions and 9 deletions

View file

@ -121,7 +121,10 @@ pub fn Create(comptime variant: InterfaceType) type {
_ = std.posix.poll(&pfds, -1) catch return;
if (pfds[1].revents & std.posix.POLL.IN != 0) return; // stop signal
if (pfds[0].revents & std.posix.POLL.IN != 0) {
self.handle_read_ready(allocator) catch return;
self.handle_read_ready(allocator) catch |e| {
std.log.err("nightwatch: handler returned {s}, stopping watch thread", .{@errorName(e)});
return;
};
}
}
}