Skip to content

Commit

Permalink
Red errors
Browse files Browse the repository at this point in the history
  • Loading branch information
fcsonline committed Nov 8, 2018
1 parent 6a76063 commit 8afd7d2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/actions/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,13 @@ impl Request {
let response = response_result.unwrap();
let duration_ms = (time::precise_time_s() - begin) * 1000.0;

println!("{:width$} {} {} {}{}", interpolated_name.green(), interpolated_url.blue().bold(), response.status.to_string().yellow(), duration_ms.round().to_string().cyan(), "ms".cyan(), width=25);
let status_text = if response.status.is_server_error() {
response.status.to_string().red()
} else {
response.status.to_string().yellow()
};

println!("{:width$} {} {} {}{}", interpolated_name.green(), interpolated_url.blue().bold(), status_text, duration_ms.round().to_string().cyan(), "ms".cyan(), width=25);

(response, duration_ms)
}
Expand Down

0 comments on commit 8afd7d2

Please sign in to comment.