Skip to content

Commit

Permalink
fix(answer): return error when request to llm failed (#3405)
Browse files Browse the repository at this point in the history
  • Loading branch information
zwpaper authored Nov 12, 2024
1 parent 7c897f5 commit c5a46ab
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ee/tabby-webserver/src/service/answer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,14 +172,14 @@ impl AnswerService {
let chunk = match chunk {
Ok(chunk) => chunk,
Err(err) => {
if let OpenAIError::StreamError(content) = err {
if let OpenAIError::StreamError(content) = &err {
if content == "Stream ended" {
break;
}
} else {
error!("Failed to get chat completion chunk: {:?}", err);
}
break;
error!("Failed to get chat completion chunk: {:?}", err);
yield Err(anyhow!("Failed to get chat completion chunk: {:?}", err).into());
return;
}
};

Expand Down

0 comments on commit c5a46ab

Please sign in to comment.