Spaces:
Running
Running
add log
Browse files- app/api/ask/route.ts +4 -0
- app/layout.tsx +1 -1
- hooks/useAi.ts +1 -1
app/api/ask/route.ts
CHANGED
|
@@ -410,6 +410,8 @@ export async function PUT(request: NextRequest) {
|
|
| 410 |
// Clear timeout if successful
|
| 411 |
if (timeoutId) clearTimeout(timeoutId);
|
| 412 |
} catch (timeoutError: any) {
|
|
|
|
|
|
|
| 413 |
// Clear timeout on error
|
| 414 |
if (timeoutId) clearTimeout(timeoutId);
|
| 415 |
|
|
@@ -687,6 +689,8 @@ This project was created with [DeepSite](https://huggingface.co/deepsite).
|
|
| 687 |
);
|
| 688 |
}
|
| 689 |
} catch (error: any) {
|
|
|
|
|
|
|
| 690 |
if (error.message?.includes('timeout') || error.message?.includes('Request timeout')) {
|
| 691 |
return NextResponse.json(
|
| 692 |
{
|
|
|
|
| 410 |
// Clear timeout if successful
|
| 411 |
if (timeoutId) clearTimeout(timeoutId);
|
| 412 |
} catch (timeoutError: any) {
|
| 413 |
+
console.log("++TIMEOUT ERROR++", timeoutError)
|
| 414 |
+
console.log("++TIMEOUT ERROR MESSAGE++", timeoutError.message)
|
| 415 |
// Clear timeout on error
|
| 416 |
if (timeoutId) clearTimeout(timeoutId);
|
| 417 |
|
|
|
|
| 689 |
);
|
| 690 |
}
|
| 691 |
} catch (error: any) {
|
| 692 |
+
console.log("++ERROR++", error)
|
| 693 |
+
console.log("++ERROR MESSAGE++", error.message)
|
| 694 |
if (error.message?.includes('timeout') || error.message?.includes('Request timeout')) {
|
| 695 |
return NextResponse.json(
|
| 696 |
{
|
app/layout.tsx
CHANGED
|
@@ -114,7 +114,7 @@ export default async function RootLayout({
|
|
| 114 |
data-domain="deepsite.hf.co"
|
| 115 |
src="https://plausible.io/js/script.js"
|
| 116 |
/>
|
| 117 |
-
<DomainRedirect />
|
| 118 |
<IframeDetector />
|
| 119 |
<Toaster richColors position="bottom-center" />
|
| 120 |
<TanstackContext>
|
|
|
|
| 114 |
data-domain="deepsite.hf.co"
|
| 115 |
src="https://plausible.io/js/script.js"
|
| 116 |
/>
|
| 117 |
+
{/* <DomainRedirect /> */}
|
| 118 |
<IframeDetector />
|
| 119 |
<Toaster richColors position="bottom-center" />
|
| 120 |
<TanstackContext>
|
hooks/useAi.ts
CHANGED
|
@@ -324,7 +324,6 @@ export const useAi = (onScrollToBottom?: () => void) => {
|
|
| 324 |
setIsAiWorking(false);
|
| 325 |
return { error: "pro_required" };
|
| 326 |
} else {
|
| 327 |
-
toast.error(res.message);
|
| 328 |
setIsAiWorking(false);
|
| 329 |
return { error: "api_error", message: res.message };
|
| 330 |
}
|
|
@@ -374,6 +373,7 @@ export const useAi = (onScrollToBottom?: () => void) => {
|
|
| 374 |
}
|
| 375 |
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
| 376 |
} catch (error: any) {
|
|
|
|
| 377 |
setIsAiWorking(false);
|
| 378 |
toast.error(error.message);
|
| 379 |
if (error.openLogin) {
|
|
|
|
| 324 |
setIsAiWorking(false);
|
| 325 |
return { error: "pro_required" };
|
| 326 |
} else {
|
|
|
|
| 327 |
setIsAiWorking(false);
|
| 328 |
return { error: "api_error", message: res.message };
|
| 329 |
}
|
|
|
|
| 373 |
}
|
| 374 |
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
| 375 |
} catch (error: any) {
|
| 376 |
+
console.log(error)
|
| 377 |
setIsAiWorking(false);
|
| 378 |
toast.error(error.message);
|
| 379 |
if (error.openLogin) {
|