Skip to content

Commit

Permalink
Merge pull request #412 from taosdata/fix/ts-5892
Browse files Browse the repository at this point in the history
fix(taos-ws): panic if deserilize text eror#TS-5892
  • Loading branch information
zitsen authored Jan 13, 2025
2 parents 486a8c7 + e46aadb commit 6163f47
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion taos-ws/src/query/asyn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,13 @@ async fn read_queries(
match frame {
Message::Text(text) => {
tracing::trace!("received json response: {text}",);
let v: WsRecv = serde_json::from_str(&text).unwrap();
// 如果text 序列化失败,打印日志,继续处理下一个消息
let v = serde_json::from_str::<WsRecv>(&text);
if let Err(err) = v {
tracing::error!("failed to deserialize json text: {text}, error: {err:?}");
return ControlFlow::Continue(());
}
let v = v.unwrap();
let queries_sender = queries_sender.clone();
let ws2 = ws2.clone();
let (req_id, data, ok) = v.ok();
Expand Down

0 comments on commit 6163f47

Please sign in to comment.