feat(#2038): hint matrix bridge errors may be a daemon restart
This commit is contained in:
parent
f477a2f901
commit
52de0ca648
1 changed files with 7 additions and 3 deletions
|
|
@ -35,9 +35,13 @@ use hive_matrix_mcp::protocol::{DaemonOp, DaemonRequest, DaemonResponse, InviteA
|
|||
/// a single round-trip) so connection pooling would be over-engineering.
|
||||
async fn round_trip(req: DaemonRequest) -> Result<DaemonResponse> {
|
||||
let socket = paths::daemon_socket();
|
||||
let stream = UnixStream::connect(&socket)
|
||||
.await
|
||||
.with_context(|| format!("connect daemon socket {}", socket.display()))?;
|
||||
let stream = UnixStream::connect(&socket).await.with_context(|| {
|
||||
format!(
|
||||
"matrix daemon unreachable at {} — it may be starting up or restarting \
|
||||
(the daemon rebinds its socket a few seconds after a restart); retry shortly",
|
||||
socket.display()
|
||||
)
|
||||
})?;
|
||||
let (reader, mut writer) = stream.into_split();
|
||||
let mut line = serde_json::to_string(&req)?;
|
||||
line.push('\n');
|
||||
|
|
|
|||
Loading…
Reference in a new issue