We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b128db3 commit 1747e6aCopy full SHA for 1747e6a
src/gax-internal/src/observability.rs
@@ -163,15 +163,13 @@ impl HttpSpanInfo {
163
}
164
Err(err) => {
165
self.otel_status = OtelStatus::Error;
166
- if err.is_timeout() {
167
- self.error_type = Some("TIMEOUT".to_string());
168
- } else if err.is_connect() {
169
- self.error_type = Some("CONNECTION_ERROR".to_string());
170
- } else if err.is_request() {
171
- self.error_type = Some("REQUEST_ERROR".to_string());
172
- } else {
173
- self.error_type = Some("UNKNOWN".to_string());
174
- }
+ let name = match err {
+ e if e.is_timeout() => "TIMEOUT",
+ e if e.is_connect() => "CONNECTION_ERROR",
+ e if e.is_request() => "REQUEST_ERROR",
+ _ => "UNKNOWN",
+ };
+ self.error_type = Some(name.to_string());
175
176
177
0 commit comments