Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
lloydzhou committed Oct 25, 2024
1 parent 2c74559 commit 90ced92
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src-tauri/src/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,9 @@ pub async fn stream_fetch(
}
}
Err(err) => {
let error: String = err.source().expect("REASON").to_string();
let error: String = err.source()
.map(|e| e.to_string())
.unwrap_or_else(|| "Unknown error occurred".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() }) {
Expand Down

0 comments on commit 90ced92

Please sign in to comment.