mirror of
https://github.com/XRPLF/rippled.git
synced 2026-04-29 15:37:57 +00:00
fix: Handle WSClient write failure when server closes WebSocket (#6671)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -184,7 +184,14 @@ public:
|
||||
jp[jss::command] = cmd;
|
||||
}
|
||||
auto const s = to_string(jp);
|
||||
ws_.write_some(true, buffer(s));
|
||||
|
||||
// Use the error_code overload to avoid an unhandled exception
|
||||
// when the server closes the WebSocket connection (e.g. after
|
||||
// booting a client that exceeded resource thresholds).
|
||||
error_code ec;
|
||||
ws_.write_some(true, buffer(s), ec);
|
||||
if (ec)
|
||||
return {};
|
||||
}
|
||||
|
||||
auto jv =
|
||||
|
||||
Reference in New Issue
Block a user