Skip to content

Commit

Permalink
update tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
youngsofun committed Aug 21, 2024
1 parent 7ef6073 commit 9d860de
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/sqllogictests/src/client/http_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,16 @@ struct QueryResponse {
// make error message the same with ErrorCode::display
fn format_error(value: serde_json::Value) -> String {
let value = value.as_object().unwrap();
let detail = value["detail"].as_str().unwrap();
let detail = value["detail"].as_str();
let code = value["code"].as_u64().unwrap();
let message = value["message"].as_str().unwrap();
if detail.is_empty() {
format!("http query error: code: {}, Text: {}", code, message)
} else {
if let Some(detail) = detail {
format!(
"http query error: code: {}, Text: {}\n{}",
code, message, detail
)
} else {
format!("http query error: code: {}, Text: {}", code, message)
}
}

Expand Down

0 comments on commit 9d860de

Please sign in to comment.