diff --git a/contrib/extension/subscription/subscription.go b/contrib/extension/subscription/subscription.go index f7aaba98392157765d3cbefb56fec669e936edd0..f970f2420606eaea17aba11d23df30150751d04b 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 }