diff --git a/pkg/subscribe/server.go b/pkg/subscribe/server.go index 0983918..688f8f3 100644 --- a/pkg/subscribe/server.go +++ b/pkg/subscribe/server.go @@ -57,6 +57,11 @@ func (s *Server) Unsubscribe(channel string) error { return s.pubSub.Unsubscribe(s.ctx, channel) } +func (s *Server) SetErrorHandle(f func(err error)) *Server { + s.errHandle = f + return s +} + func (s *Server) Run() { ch := s.pubSub.Channel() defer s.pubSub.Close()