@@ -253,6 +253,10 @@ func (c *Client) reader() {
continue
}
+
+ case MessageTypeError:
+ // 错误消息
+ c.Received <- message
@@ -294,6 +294,8 @@ func deserializeMessage(data []byte, opts ...messageOption) Message {
var location Location
_ = json.Unmarshal(data, &location)
msg = &location
+ default:
+ msg = &Err{MessageImpl: messageImpl, Content: "unknown message type"}
for _, opt := range opts {