cleanup
This commit is contained in:
parent
05176c7742
commit
81322c7256
7 changed files with 25 additions and 22 deletions
|
|
@ -154,7 +154,10 @@ async fn run_stream(
|
|||
|
||||
if !response.status().is_success() {
|
||||
let status = response.status();
|
||||
let body_text = response.text().await.unwrap_or_default();
|
||||
let body_text = match response.text().await {
|
||||
Ok(t) => t,
|
||||
Err(e) => format!("(failed to read error body: {e})"),
|
||||
};
|
||||
let _ = tx
|
||||
.send(StreamEvent::Error(format!("HTTP {status}: {body_text}")))
|
||||
.await;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue