From 42da6f884056ec6165c420d05bd76d245d3cc9dd Mon Sep 17 00:00:00 2001 From: rmanach Date: Sat, 22 Apr 2023 15:32:57 +0200 Subject: [PATCH] fix handler error catch --- src/worker/worker.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/worker/worker.rs b/src/worker/worker.rs index 9a2ccab..f44e582 100644 --- a/src/worker/worker.rs +++ b/src/worker/worker.rs @@ -108,12 +108,9 @@ impl Worker { // TODO: the message could be requeued if needed if let Err(e) = handler.handle(runner.run()) { - match e { - HandlerError::Unknown => { - Worker::::set_status(&status, WorkerStatus::Failed); - break; - } - _ => (), + if let HandlerError::Unknown = e { + Worker::::set_status(&status, WorkerStatus::Failed); + break; } } // TODO: collect a message from the handler (modify the signature)