Skip to content

hotfix for statusText is non ISO-8859-1 #5717 #5719

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 25, 2024
Merged
Changes from 1 commit
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
13 changes: 11 additions & 2 deletions src-tauri/src/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,20 @@ pub async fn stream_fetch(
}
}
Err(err) => {
println!("Error response: {:?}", err.source().expect("REASON").to_string());
let error: String = err.source().expect("REASON").to_string();
println!("Error response: {:?}", error);
tauri::async_runtime::spawn( async move {
if let Err(e) = window.emit(event_name, ChunkPayload{ request_id, chunk: error.into() }) {
println!("Failed to emit chunk payload: {:?}", e);
}
if let Err(e) = window.emit(event_name, EndPayload{ request_id, status: 0 }) {
println!("Failed to emit end payload: {:?}", e);
}
});
StreamResponse {
request_id,
status: 599,
status_text: err.source().expect("REASON").to_string(),
status_text: "Error".to_string(),
headers: HashMap::new(),
}
}
Expand Down