Skip to content

Commit 2933aaa

Browse files
authored
fix: opaque error when session expires (#3208)
1 parent b3fa226 commit 2933aaa

File tree

1 file changed

+20
-0
lines changed
  • crates/chat-cli/src/cli/chat

1 file changed

+20
-0
lines changed

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -832,6 +832,26 @@ impl ChatSession {
832832
}
833833

834834
let (context, report, display_err_message) = match err {
835+
ChatError::Auth(AuthError::NoToken) => {
836+
execute!(
837+
self.stderr,
838+
style::SetAttribute(Attribute::Bold),
839+
StyledText::error_fg(),
840+
style::Print("Authentication Error\n"),
841+
StyledText::reset_attributes(),
842+
StyledText::reset(),
843+
style::Print("\nYour login session has expired. Please log in again using:\n\n"),
844+
StyledText::success_fg(),
845+
style::Print(" q login\n\n"),
846+
StyledText::reset(),
847+
)?;
848+
849+
self.conversation
850+
.append_transcript("Authentication expired - please log in again".to_string());
851+
852+
self.inner = Some(ChatState::Exit);
853+
return Ok(());
854+
},
835855
ChatError::Interrupted { tool_uses: ref inter } => {
836856
execute!(self.stderr, style::Print("\n\n"))?;
837857

0 commit comments

Comments
 (0)