From 6e6877f36ca98adca99bc7038d7a133e85e852fe Mon Sep 17 00:00:00 2001 From: a <a@tuxpa.in> Date: Fri, 2 Feb 2024 03:45:04 -0600 Subject: [PATCH] add error back --- contrib/extension/subscription/subscription.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/contrib/extension/subscription/subscription.go b/contrib/extension/subscription/subscription.go index f7aaba9..f970f24 100644 --- a/contrib/extension/subscription/subscription.go +++ b/contrib/extension/subscription/subscription.go @@ -89,7 +89,7 @@ type Notifier struct { mu sync.Mutex id SubID - err chan error // closed on unsubscribe + err chan error } // Notify sends a notification to the client with the given data as payload. @@ -110,8 +110,14 @@ func (n *Notifier) Err() <-chan error { func (n *Notifier) send(data json.RawMessage) error { params, _ := jjson.Marshal(&subscriptionResult{ID: string(n.id), Result: data}) - return n.h.Notify( + err := n.h.Notify( n.namespace+ serviceMethodSeparator+ notificationMethodSuffix, json.RawMessage(params)) + + if err != nil { + n.err <- err + return err + } + return nil } -- GitLab