diff --git a/receiver_func.go b/receiver_func.go index 8e0ed8d..2b6c06e 100644 --- a/receiver_func.go +++ b/receiver_func.go @@ -17,7 +17,12 @@ func ReceiverFrom(handler any) Receiver { case Receiver: return h case func() error: - return FuncReceiver(func(msg Message) error { h(); return msg.Ack() }) + return FuncReceiver(func(msg Message) error { + if err := h(); err != nil { + return err + } + return msg.Ack() + }) case func(msg Message) error: return FuncReceiver(h) case func(ctx context.Context, msg Message) error: