Skip to content

Commit

Permalink
refactor error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
neowu committed Apr 22, 2024
1 parent 9afcf22 commit cf18902
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/gcloud/vertex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ impl Vertex {
let (tx, rx) = channel(64);
let handle = tokio::spawn(read_response_stream(response, tx));
let function_call = self.process_response(rx, handler).await;
let _ = tokio::try_join!(handle)?;
handle.await??;

Ok(function_call)
}
Expand Down
2 changes: 1 addition & 1 deletion src/openai/chatgpt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ impl ChatGPT {
let handle = tokio::spawn(read_event_source(source, tx));

let function_call = self.process_event(rx, handler).await;
let _ = tokio::try_join!(handle)?;
handle.await??;

Ok(function_call)
}
Expand Down

0 comments on commit cf18902

Please sign in to comment.