summaryrefslogtreecommitdiffstats
path: root/src/client/cohere.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/cohere.rs')
-rw-r--r--src/client/cohere.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/client/cohere.rs b/src/client/cohere.rs
index e2a23b0..7f07640 100644
--- a/src/client/cohere.rs
+++ b/src/client/cohere.rs
@@ -48,7 +48,7 @@ async fn send_message(builder: RequestBuilder) -> Result<(String, CompletionDeta
let res = builder.send().await?;
let status = res.status();
let data: Value = res.json().await?;
- if status != 200 {
+ if !status.is_success() {
catch_error(&data, status.as_u16())?;
}
@@ -58,7 +58,7 @@ async fn send_message(builder: RequestBuilder) -> Result<(String, CompletionDeta
async fn send_message_streaming(builder: RequestBuilder, handler: &mut SseHandler) -> Result<()> {
let res = builder.send().await?;
let status = res.status();
- if status != 200 {
+ if !status.is_success() {
let data: Value = res.json().await?;
catch_error(&data, status.as_u16())?;
} else {