Skip to content

Commit b9abf68

Browse files
Updated comments and messages
1 parent 31f9874 commit b9abf68

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

engine/access/rest/websockets/controller.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,11 @@ func (c *Controller) handleAction(ctx context.Context, message interface{}) erro
161161
}
162162

163163
func (c *Controller) handleSubscribe(ctx context.Context, msg models.SubscribeMessageRequest) {
164-
dp, _ := c.dataProviderFactory.NewDataProvider(ctx, msg.Topic, msg.Arguments, c.communicationChannel)
165-
// TODO: handle error here
164+
dp, err := c.dataProviderFactory.NewDataProvider(ctx, msg.Topic, msg.Arguments, c.communicationChannel)
165+
if err != nil {
166+
// TODO: handle error here
167+
}
168+
166169
c.dataProviders.Add(dp.ID(), dp)
167170

168171
//TODO: return OK response to client
@@ -171,7 +174,7 @@ func (c *Controller) handleSubscribe(ctx context.Context, msg models.SubscribeMe
171174
go func() {
172175
err := dp.Run()
173176
if err != nil {
174-
// Log or handle the error from Run
177+
//TODO: Log or handle the error from Run
175178
c.logger.Error().Err(err).Msgf("error while running data provider for topic: %s", msg.Topic)
176179
}
177180
}()

engine/access/rest/websockets/data_providers/factory.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ func (s *DataProviderFactoryImpl) NewDataProvider(
9191
case EventsTopic,
9292
AccountStatusesTopic,
9393
TransactionStatusesTopic:
94-
return nil, fmt.Errorf("topic \"%s\" not implemented yet", topic)
94+
return nil, fmt.Errorf(`topic "%s" not implemented yet`, topic)
9595
default:
9696
return nil, fmt.Errorf("unsupported topic \"%s\"", topic)
9797
}

0 commit comments

Comments
 (0)