fix handler error catch

This commit is contained in:
rmanach 2023-04-22 15:32:57 +02:00
parent b82d968e49
commit 42da6f8840

View File

@ -108,12 +108,9 @@ impl<H: Handler, N: Notifier> Worker<H, N> {
// TODO: the message could be requeued if needed
if let Err(e) = handler.handle(runner.run()) {
match e {
HandlerError::Unknown => {
Worker::<H, N>::set_status(&status, WorkerStatus::Failed);
break;
}
_ => (),
if let HandlerError::Unknown = e {
Worker::<H, N>::set_status(&status, WorkerStatus::Failed);
break;
}
}
// TODO: collect a message from the handler (modify the signature)