Feature/unified nl search #106
@@ -191,11 +191,13 @@ impl ClipClient {
|
||||
let resp = match self.client.post(&url).json(&body).send().await {
|
||||
Ok(r) => r,
|
||||
Err(e) if e.is_timeout() || e.is_connect() => {
|
||||
log::warn!("clip encode_text network error to {url}: {e}");
|
||||
return Err(ClipError::Transient(anyhow::anyhow!(
|
||||
"clip client network: {e}"
|
||||
)));
|
||||
}
|
||||
Err(e) => {
|
||||
log::warn!("clip encode_text request error to {url}: {e}");
|
||||
return Err(ClipError::Transient(anyhow::anyhow!(
|
||||
"clip client request: {e}"
|
||||
)));
|
||||
@@ -210,6 +212,7 @@ impl ClipClient {
|
||||
return Ok(body);
|
||||
}
|
||||
let body_text = resp.text().await.unwrap_or_default();
|
||||
log::warn!("clip encode_text HTTP {status} from {url}: {body_text}");
|
||||
Err(classify_error_response(status.as_u16(), &body_text))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user