mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-04 15:10:54 +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:
@@ -553,7 +553,7 @@ func (h *HUOBI) Subscribe(channelsToSubscribe []stream.ChannelSubscription) erro
|
||||
return err
|
||||
}
|
||||
}
|
||||
var errs common.Errors
|
||||
var errs error
|
||||
for i := range channelsToSubscribe {
|
||||
if (strings.Contains(channelsToSubscribe[i].Channel, "orders.") ||
|
||||
strings.Contains(channelsToSubscribe[i].Channel, "accounts")) && creds != nil {
|
||||
@@ -562,7 +562,7 @@ func (h *HUOBI) Subscribe(channelsToSubscribe []stream.ChannelSubscription) erro
|
||||
wsAccountsOrdersEndPoint+channelsToSubscribe[i].Channel,
|
||||
channelsToSubscribe[i].Channel)
|
||||
if err != nil {
|
||||
errs = append(errs, err)
|
||||
errs = common.AppendError(errs, err)
|
||||
continue
|
||||
}
|
||||
h.Websocket.AddSuccessfulSubscriptions(channelsToSubscribe[i])
|
||||
@@ -572,7 +572,7 @@ func (h *HUOBI) Subscribe(channelsToSubscribe []stream.ChannelSubscription) erro
|
||||
Subscribe: channelsToSubscribe[i].Channel,
|
||||
})
|
||||
if err != nil {
|
||||
errs = append(errs, err)
|
||||
errs = common.AppendError(errs, err)
|
||||
continue
|
||||
}
|
||||
h.Websocket.AddSuccessfulSubscriptions(channelsToSubscribe[i])
|
||||
@@ -593,7 +593,7 @@ func (h *HUOBI) Unsubscribe(channelsToUnsubscribe []stream.ChannelSubscription)
|
||||
return err
|
||||
}
|
||||
}
|
||||
var errs common.Errors
|
||||
var errs error
|
||||
for i := range channelsToUnsubscribe {
|
||||
if (strings.Contains(channelsToUnsubscribe[i].Channel, "orders.") ||
|
||||
strings.Contains(channelsToUnsubscribe[i].Channel, "accounts")) && creds != nil {
|
||||
@@ -602,7 +602,7 @@ func (h *HUOBI) Unsubscribe(channelsToUnsubscribe []stream.ChannelSubscription)
|
||||
wsAccountsOrdersEndPoint+channelsToUnsubscribe[i].Channel,
|
||||
channelsToUnsubscribe[i].Channel)
|
||||
if err != nil {
|
||||
errs = append(errs, err)
|
||||
errs = common.AppendError(errs, err)
|
||||
continue
|
||||
}
|
||||
h.Websocket.RemoveSuccessfulUnsubscriptions(channelsToUnsubscribe[i])
|
||||
@@ -612,7 +612,7 @@ func (h *HUOBI) Unsubscribe(channelsToUnsubscribe []stream.ChannelSubscription)
|
||||
Unsubscribe: channelsToUnsubscribe[i].Channel,
|
||||
})
|
||||
if err != nil {
|
||||
errs = append(errs, err)
|
||||
errs = common.AppendError(errs, err)
|
||||
continue
|
||||
}
|
||||
h.Websocket.RemoveSuccessfulUnsubscriptions(channelsToUnsubscribe[i])
|
||||
|
||||
Reference in New Issue
Block a user