Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

Fix: The requested interface timeout will cause the page to crash #4787 (#4788)

balibabu5a51bdd824db
diff --git a/web/src/utils/request.ts b/web/src/utils/request.ts
index fe15772897..d7c0673903 100644
--- a/web/src/utils/request.ts
+++ b/web/src/utils/request.ts
@@ -68,7 +68,7 @@ const errorHandler = (error: {
});
}
}
- return response;
+ return response ?? { data: { code: 1999 } };
};
const request: RequestMethod = extend({
@@ -98,7 +98,7 @@ request.interceptors.request.use((url: string, options: any) => {
};
});
-request.interceptors.response.use(async (response: any, options) => {
+request.interceptors.response.use(async (response: Response, options) => {
if (response?.status === 413 || response?.status === 504) {
message.error(RetcodeMessage[response?.status as ResultCode]);
}