We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 39f9f11 commit 791b138Copy full SHA for 791b138
tonic/src/status.rs
@@ -614,6 +614,11 @@ fn find_status_in_source_chain(err: &(dyn Error + 'static)) -> Option<Status> {
614
return Some(Status::cancelled(timeout.to_string()));
615
}
616
617
+ // If we are unable to connect to the server, map this to UNAVAILABLE. This is
618
+ // consistent with the behavior of a C++ gRPC client when the server is not running, and
619
+ // matches the spec of:
620
+ // > The service is currently unavailable. This is most likely a transient condition that
621
+ // > can be corrected if retried with a backoff.
622
#[cfg(feature = "transport")]
623
if let Some(connect) = err.downcast_ref::<crate::transport::ConnectError>() {
624
return Some(Status::unavailable(connect.to_string()));
0 commit comments