diff --git a/core/commands/pubsub.go b/core/commands/pubsub.go index ac3234c7879..374757f24f2 100644 --- a/core/commands/pubsub.go +++ b/core/commands/pubsub.go @@ -84,6 +84,9 @@ This command outputs data in the following encodings: discover, _ := req.Options["discover"].(bool) sub, err := api.PubSub().Subscribe(req.Context, topic, options.PubSub.Discover(discover)) + if err != nil { + return err + } defer sub.Close() if f, ok := res.(http.Flusher); ok { diff --git a/core/coreapi/interface/pubsub.go b/core/coreapi/interface/pubsub.go index 4c9a1d73e5b..d7a21e02f1a 100644 --- a/core/coreapi/interface/pubsub.go +++ b/core/coreapi/interface/pubsub.go @@ -38,7 +38,6 @@ type PubSubAPI interface { Ls(context.Context) ([]string, error) // Peers list peers we are currently pubsubbing with - // TODO: WithTopic Peers(context.Context, ...options.PubSubPeersOption) ([]peer.ID, error) // Publish a message to a given pubsub topic