mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-29 15:10:37 +00:00
common: update Errors type (#1129)
* common: adjust common error slice to allow multi errors.Is matching and conform to interface better * zb: forgot to save? * linties: fixies * linties: word change as well. * nitters: glorious * buts * nitters: fix glorious bug * Update common/common.go Co-authored-by: Scott <gloriousCode@users.noreply.github.com> * nitters: shifty --------- Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io> Co-authored-by: Scott <gloriousCode@users.noreply.github.com>
This commit is contained in:
@@ -299,7 +299,7 @@ func (z *ZB) GenerateDefaultSubscriptions() ([]stream.ChannelSubscription, error
|
||||
|
||||
// Subscribe sends a websocket message to receive data from the channel
|
||||
func (z *ZB) Subscribe(channelsToSubscribe []stream.ChannelSubscription) error {
|
||||
var errs common.Errors
|
||||
var errs error
|
||||
for i := range channelsToSubscribe {
|
||||
subscriptionRequest := Subscription{
|
||||
Event: zWebsocketAddChannel,
|
||||
@@ -307,7 +307,7 @@ func (z *ZB) Subscribe(channelsToSubscribe []stream.ChannelSubscription) error {
|
||||
}
|
||||
err := z.Websocket.Conn.SendJSONMessage(subscriptionRequest)
|
||||
if err != nil {
|
||||
errs = append(errs, err)
|
||||
errs = common.AppendError(errs, err)
|
||||
continue
|
||||
}
|
||||
z.Websocket.AddSuccessfulSubscriptions(channelsToSubscribe[i])
|
||||
|
||||
Reference in New Issue
Block a user