feat: enhance error handling in OAuth URL building and client creation; improve tool argument sanitization

This commit is contained in:
asepharyana
2026-07-12 10:23:26 +07:00
parent 0cc60c12ce
commit bb621fdff2
10 changed files with 79 additions and 43 deletions
+8 -2
View File
@@ -29,11 +29,17 @@ impl LlmClient {
} else {
model
};
let client = reqwest::blocking::Client::builder()
let client = match reqwest::blocking::Client::builder()
.timeout(REQUEST_TIMEOUT)
.connect_timeout(CONNECT_TIMEOUT)
.build()
.unwrap_or_else(|_| reqwest::blocking::Client::new());
{
Ok(c) => c,
Err(e) => {
eprintln!("warning: failed to build reqwest client with timeouts: {}. Using default client without timeouts.", e);
reqwest::blocking::Client::new()
}
};
LlmClient {
client,
api_key,