diff options
| author | sigoden <sigoden@gmail.com> | 2023-03-08 16:06:24 +0800 |
|---|---|---|
| committer | sigoden <sigoden@gmail.com> | 2023-03-08 16:06:24 +0800 |
| commit | 2a7a6f5f27ae6343c1aa235563cbddb6cb40f557 (patch) | |
| tree | 1ab01b81d26a5c2a820063e0700ae69781d15440 /src/client.rs | |
| parent | 4e729db237dbfb93d32bfa43b60a09be07d49630 (diff) | |
| download | aichat-2a7a6f5f27ae6343c1aa235563cbddb6cb40f557.tar.gz | |
chore: no longer ignore any error
Diffstat (limited to 'src/client.rs')
| -rw-r--r-- | src/client.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/client.rs b/src/client.rs index 19e6c27..11a5f3b 100644 --- a/src/client.rs +++ b/src/client.rs @@ -54,11 +54,11 @@ impl ChatGptClient { self.runtime.block_on(async { tokio::select! { ret = self.send_message_streaming_inner(input, prompt, handler) => { - handler.done(); + handler.done()?; ret.with_context(|| "Failed to send message streaming") } _ = watch_abort(abort.clone()) => { - handler.done(); + handler.done()?; Ok(()) }, _ = tokio::signal::ctrl_c() => { @@ -91,7 +91,7 @@ impl ChatGptClient { handler: &mut ReplyStreamHandler, ) -> Result<()> { if self.config.borrow().dry_run { - handler.text(&combine(content, prompt)); + handler.text(&combine(content, prompt))?; return Ok(()); } let builder = self.request_builder(content, prompt, true)?; @@ -115,7 +115,7 @@ impl ChatGptClient { continue; } } - handler.text(text); + handler.text(text)?; } } |
