Skip to content

Commit

Permalink
消息消费大循环中遇到OperationCanceledException时,不要输出异常日志,避免StarServer退出时提示错误
Browse files Browse the repository at this point in the history
  • Loading branch information
nnhy committed May 15, 2024
1 parent a7a44ef commit 7fe49f5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions Stardust.Server/Controllers/AppController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ private async Task ConsumeMessage(WebSocket socket, App app, String clientId, St
}
}
catch (TaskCanceledException) { }
catch (OperationCanceledException) { }
catch (Exception ex)
{
XTrace.WriteLine("WebSocket异常 app={0} ip={1}", app, ip);
Expand Down
1 change: 1 addition & 0 deletions Stardust.Server/Controllers/NodeController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,7 @@ private async Task ConsumeMessage(WebSocket socket, Node node, String ip, Cancel
}
}
catch (TaskCanceledException) { }
catch (OperationCanceledException) { }
catch (Exception ex)
{
XTrace.WriteLine("WebSocket异常 node={0} ip={1}", node, ip);
Expand Down

0 comments on commit 7fe49f5

Please sign in to comment.