We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3c723ee commit a30908fCopy full SHA for a30908f
crates/common/src/json_client.rs
@@ -9,7 +9,7 @@ use crate::types::ApiResult;
9
use axum::Json;
10
use reqwest::{Client, Method, Url};
11
use serde::de::DeserializeOwned;
12
-use tracing::info;
+use tracing::{error, info};
13
14
#[derive(Clone)]
15
pub struct JsonClient {
@@ -46,7 +46,20 @@ impl JsonClient {
46
return Err(BlockfrostError::not_found());
47
}
48
49
- let body = resp.json::<T>().await?;
+ let status = resp.status();
50
+ let body_text = resp.text().await?;
51
+
52
+ let body: T = serde_json::from_str(&body_text).map_err(|e| {
53
+ error!(
54
+ path,
55
+ url = %url_str,
56
+ status = %status,
57
+ response_body = %body_text,
58
+ error = %e,
59
+ "JsonClient failed to parse response"
60
+ );
61
+ e
62
+ })?;
63
64
Ok(Json(body))
65
0 commit comments