Skip to content

Commit f67d72a

Browse files
committed
added diagnostic traces
1 parent 645a7c1 commit f67d72a

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/client/get_request.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ impl crate::Client {
7979
},
8080
Err(error) => {
8181
tracing::error!("JSON deserialization error: {error}");
82+
if let Ok(text) = String::from_utf8(bytes) {
83+
tracing::trace!("{text}");
84+
}
8285
Err(Error::from(error))
8386
},
8487
}, // Ok
@@ -89,7 +92,7 @@ impl crate::Client {
8992
} // match
9093
} else {
9194
tracing::error!(
92-
"Google Maps API HTTP request was not successful: {status}",
95+
"Google Maps API HTTP request unsuccessful: {status}",
9396
status = response.status(),
9497
);
9598
Err(Error::from(response.status()))

src/client/post_request.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ impl crate::Client {
8787
},
8888
Err(error) => {
8989
tracing::error!("JSON deserialization error: {error}");
90+
if let Ok(text) = String::from_utf8(bytes) {
91+
tracing::trace!("{text}");
92+
}
9093
Err(Error::from(error))
9194
},
9295
}, // Ok
@@ -97,7 +100,7 @@ impl crate::Client {
97100
} // match
98101
} else {
99102
tracing::error!(
100-
"Google Maps API HTTP request was not successful: {status}",
103+
"Google Maps API HTTP request was unsuccessful: {status}",
101104
status = response.status(),
102105
);
103106
Err(Error::from(response.status()))

0 commit comments

Comments
 (0)