Skip to content

Commit

Permalink
[Obs AI Assistant] Avoid showing error toast when action is aborted b…
Browse files Browse the repository at this point in the history
…y user (elastic#186794)
  • Loading branch information
viduni94 committed Oct 7, 2024
1 parent 28d6a22 commit 3eb2372
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,11 @@ function useChatWithoutContext({
(error: Error) => {
if (error instanceof AbortError) {
setChatState(ChatState.Aborted);
} else {
setChatState(ChatState.Error);
return;
}

setChatState(ChatState.Error);

if (isTokenLimitReachedError(error)) {
setMessages((msgs) => [
...msgs,
Expand Down

0 comments on commit 3eb2372

Please sign in to comment.