aboutsummaryrefslogtreecommitdiff
path: root/src/cli/plugin.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/cli/plugin.rs')
-rw-r--r--src/cli/plugin.rs21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/cli/plugin.rs b/src/cli/plugin.rs
index b4e6d514..efdb9eca 100644
--- a/src/cli/plugin.rs
+++ b/src/cli/plugin.rs
@@ -1618,14 +1618,19 @@ fn current_unix_ms() -> u64 {
}
fn is_connection_error(err: &std::io::Error) -> bool {
- matches!(
- err.kind(),
- std::io::ErrorKind::NotFound
- | std::io::ErrorKind::ConnectionRefused
- | std::io::ErrorKind::ConnectionAborted
- | std::io::ErrorKind::ConnectionReset
- | std::io::ErrorKind::BrokenPipe
- )
+ // A `server_not_running` marker is a connect failure for recovery purposes:
+ // treating it as a connection error lets plugin commands fall back to the
+ // offline registry. The marker carries (but does not print) a friendly
+ // response, so recovering here prints nothing.
+ super::server_not_running_was_reported(err)
+ || matches!(
+ err.kind(),
+ std::io::ErrorKind::NotFound
+ | std::io::ErrorKind::ConnectionRefused
+ | std::io::ErrorKind::ConnectionAborted
+ | std::io::ErrorKind::ConnectionReset
+ | std::io::ErrorKind::BrokenPipe
+ )
}
fn print_plugin_response(method: Method) -> std::io::Result<i32> {