Skip to content

Commit bd5457e

Browse files
authored
Merge pull request #3041 from itowlson/error-after-http-response-started-is-still-an-error
If a component errors after starting the response, show that error
2 parents 0de8809 + 91c15ad commit bd5457e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

crates/trigger-http/src/wasi.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use std::io::IsTerminal;
12
use std::net::SocketAddr;
23

34
use anyhow::{anyhow, Context, Result};
@@ -144,7 +145,11 @@ impl HttpExecutor for WasiHttpExecutor {
144145
Ok(())
145146
}
146147
.map_err(|e: anyhow::Error| {
147-
tracing::warn!("component error after response: {e:?}");
148+
if std::io::stderr().is_terminal() {
149+
tracing::error!("Component error after response started. The response may not be fully sent: {e:?}");
150+
} else {
151+
terminal::warn!("Component error after response started: {e:?}");
152+
}
148153
}),
149154
);
150155

0 commit comments

Comments
 (0)