Skip to content

Commit dc80037

Browse files
committed
Catch prewarm errors safely
1 parent 1a9f26d commit dc80037

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

web/src/app/api/planner.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,16 @@ export const getLLMResponse = async (payload: any, signal?: AbortSignal, deepres
2323
}).catch((error: Error | AxiosError) => {
2424
// check if unauthorized response, logout and throw error
2525
// otherwise pass error up
26+
if (payload.isPrewarm) {
27+
return {
28+
data: {
29+
tool_calls: [],
30+
finish_reason: 'prewarm',
31+
content: '',
32+
tasks: []
33+
}
34+
}
35+
}
2636
if (axios.isAxiosError(error) && error.response) {
2737
if (error.response.status === 401 || error.response.status === 403) {
2838
logoutState();

0 commit comments

Comments
 (0)