mirror of
https://github.com/openai/codex.git
synced 2026-11-13 21:30:47 +00:00
Log HTTP errors as errors
This commit is contained in:
@@ -117,6 +117,27 @@ impl CodexRequestBuilder {
|
||||
match self.builder.send().await {
|
||||
Ok(response) => {
|
||||
let request_ids = Self::extract_request_ids(&response);
|
||||
let is_error = !response.status().is_success();
|
||||
if is_error {
|
||||
tracing::error!(
|
||||
method = %self.method,
|
||||
url = %self.url,
|
||||
status = %response.status(),
|
||||
request_ids = ?request_ids,
|
||||
version = ?response.version(),
|
||||
"Request failed"
|
||||
);
|
||||
} else {
|
||||
tracing::debug!(
|
||||
method = %self.method,
|
||||
url = %self.url,
|
||||
status = %response.status(),
|
||||
request_ids = ?request_ids,
|
||||
version = ?response.version(),
|
||||
"Request completed"
|
||||
);
|
||||
}
|
||||
|
||||
tracing::debug!(
|
||||
method = %self.method,
|
||||
url = %self.url,
|
||||
|
||||
Reference in New Issue
Block a user