Skip to content

Commit 9a60489

Browse files
chore: increase granularity of RecvError reason code (#259)
1 parent 79e1d14 commit 9a60489

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

crates/chat-cli/src/cli/chat/parser.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,12 @@ impl RecvError {
4040

4141
impl ReasonCode for RecvError {
4242
fn reason_code(&self) -> String {
43-
"RecvError".to_string()
43+
match &self.source {
44+
RecvErrorKind::Client(_) => "RecvErrorApiClient".to_string(),
45+
RecvErrorKind::Json(_) => "RecvErrorJson".to_string(),
46+
RecvErrorKind::StreamTimeout { .. } => "RecvErrorStreamTimeout".to_string(),
47+
RecvErrorKind::UnexpectedToolUseEos { .. } => "RecvErrorUnexpectedToolUseEos".to_string(),
48+
}
4449
}
4550
}
4651

0 commit comments

Comments
 (0)