Skip to content

Commit

Permalink
Release: v1.0.11-alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
amir-the-h committed Sep 29, 2021
1 parent a6c60aa commit 6ab32ef
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@ Changelog
=========
All notable changes to this project will be documented in this file.

v1.0.11-alpha
------------

### Changed

- Better error handling on `Ws`

v1.0.10-alpha
------------

Expand Down
17 changes: 11 additions & 6 deletions api/ws/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,18 @@ func (c *ClientWs) process(data []byte, e *events.Basic) bool {
}()
return true
}
if c.Private.Process(data, e) {
return true
}
if c.Public.Process(data, e) {
return true
}
if e.ID != "" {
if e.Code != 0 {
ee := *e
ee.Event = "error"
return c.process(data, &ee)
}
e := events.Success{}
_ = json.Unmarshal(data, &e)
go func() {
Expand All @@ -377,12 +388,6 @@ func (c *ClientWs) process(data []byte, e *events.Basic) bool {
}()
return true
}
if c.Private.Process(data, e) {
return true
}
if c.Public.Process(data, e) {
return true
}
go func() { c.RawEventChan <- e }()

return false
Expand Down
3 changes: 3 additions & 0 deletions events/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ type (
Msg string `json:"msg,omitempty"`
Op string `json:"op,omitempty"`
Code okex.JSONInt64 `json:"code"`
Args []*Argument `json:"args,omitempty"`
Arg *Argument `json:"arg,omitempty"`
Data []*Argument `json:"data,omitempty"`
ID string `json:"id,omitempty"`
}
Login struct {
Expand Down

0 comments on commit 6ab32ef

Please sign in to comment.