summaryrefslogtreecommitdiffstats
path: root/src/client.rs
diff options
context:
space:
mode:
authorsigoden <sigoden@gmail.com>2023-03-12 08:31:06 +0800
committerGitHub <noreply@github.com>2023-03-12 08:31:06 +0800
commit8fa2e2683bdb89aef5baf22957af1d86ed38aca7 (patch)
tree3434c9c2610724a9507d5cca082f637b2f1d576a /src/client.rs
parent0ed0ad1fd26cccb9f41379e2f0f2c77fca43c608 (diff)
downloadaichat-8fa2e2683bdb89aef5baf22957af1d86ed38aca7.tar.gz
feat: support HTTPS_PROXY and ALL_PROXY (#68)
Diffstat (limited to 'src/client.rs')
-rw-r--r--src/client.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/client.rs b/src/client.rs
index 7fc2824..916a1ef 100644
--- a/src/client.rs
+++ b/src/client.rs
@@ -126,7 +126,8 @@ impl ChatGptClient {
fn build_client(&self) -> Result<Client> {
let mut builder = Client::builder();
if let Some(proxy) = self.config.read().proxy.as_ref() {
- builder = builder.proxy(Proxy::all(proxy).with_context(|| "Invalid config.proxy")?);
+ builder = builder
+ .proxy(Proxy::all(proxy).with_context(|| format!("Invalid proxy `{proxy}`"))?);
}
let client = builder
.connect_timeout(CONNECT_TIMEOUT)