Merge pull request #687 from mitchellh/cancel

renderer: handle error.NotFound for timer cancellation
This commit is contained in:
Mitchell Hashimoto
2023-10-15 21:44:42 -07:00
committed by GitHub

View File

@ -382,11 +382,13 @@ fn cursorCancelCallback(
// support different sets of errors, so we just unify it.
const CancelError = xev.Timer.CancelError || error{
Canceled,
NotFound,
Unexpected,
};
_ = r catch |err| switch (@as(CancelError, @errorCast(err))) {
error.Canceled => {},
error.Canceled => {}, // success
error.NotFound => {}, // completed before it could cancel
else => {
log.warn("error in cursor cancel callback err={}", .{err});
unreachable;