Send back developer error correctly (#195)

This commit is contained in:
Adil Hafeez 2024-10-18 13:14:18 -07:00 committed by GitHub
parent 28421353fd
commit 1719b7d5f8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 28 additions and 13 deletions

View file

@ -316,10 +316,9 @@ impl HttpContext for StreamContext {
let chat_completions_response: ChatCompletionsResponse =
match serde_json::from_slice(&body) {
Ok(de) => de,
Err(e) => {
Err(_e) => {
debug!("invalid response: {}", String::from_utf8_lossy(&body));
self.send_server_error(ServerError::Deserialization(e), None);
return Action::Pause;
return Action::Continue;
}
};