Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src-tauri/src/proxy/handlers/gemini.rs
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,13 @@ pub async fn handle_generate(
Some(Ok(b)) => b,
Some(Err(e)) => {
error!("[Gemini-SSE] Connection error: {}", e);
yield Err(format!("Stream error: {}", e));
let error_json = serde_json::json!({
"error": {
"message": format!("Stream error: {}", e),
"type": "stream_error"
}
});
yield Ok::<Bytes, String>(Bytes::from(format!("data: {}\n\n", error_json)));
break;
}
None => break,
Expand Down
8 changes: 7 additions & 1 deletion src-tauri/src/proxy/mappers/claude/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,13 @@ where
}
}
Err(e) => {
yield Err(format!("Stream error: {}", e));
let error_json = serde_json::json!({
"error": {
"message": format!("Stream error: {}", e),
"type": "stream_error"
}
});
yield Ok::<Bytes, String>(Bytes::from(format!("data: {}\n\n", error_json)));
break;
}
}
Expand Down
Loading