Skip to content

Commit bd56a58

Browse files
committed
Fix 401 error handling
1 parent 366f94c commit bd56a58

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

web/src/app/api/planner.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,7 @@ export const getLLMResponse = async (payload: any, signal?: AbortSignal, deepres
3535
}
3636
if (axios.isAxiosError(error) && error.response) {
3737
if (error.response.status === 401 || error.response.status === 403) {
38-
logoutState();
39-
toast({
40-
title: 'Unauthorized',
41-
description: "Please login again",
42-
status: 'error',
43-
duration: 5000,
44-
isClosable: true,
45-
position: 'bottom-right',
46-
})
47-
throw new Error("Unauthorized, please login again")
38+
throw new Error("Authentication error occurred.")
4839
} else if (error.response.status === 402) {
4940
// Hack to capture billing event
5041
dispatch({

0 commit comments

Comments
 (0)