diff --git a/src/main.rs b/src/main.rs index 8dfd50c..7268c59 100644 --- a/src/main.rs +++ b/src/main.rs @@ -169,7 +169,11 @@ async fn main() -> Result<(), Box> { if args.verbose { let mut body = response.text().await?; if pretty { - body = serde_json::to_string_pretty(&serde_json::from_str::(&body)?)?; + if let Ok(v) = serde_json::from_str::(&body) { + if let Ok(t) = serde_json::to_string_pretty(&v) { + body = t; + } + } } println!(" │ {}", body.replace("\n", "\n │ ")); println!(" │");