mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-07-20 23:21:06 +02:00
feat(chat): improve error handling and logging for premium quota exhaustion in chat operations
This commit is contained in:
parent
e6db050dfd
commit
222b27183f
1 changed files with 17 additions and 3 deletions
|
|
@ -1018,8 +1018,12 @@ export default function NewChatPage() {
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
console.error("[NewChatPage] Chat error:", error);
|
|
||||||
const premiumQuotaAlertMessage = getPinnedPremiumQuotaErrorMessage(error);
|
const premiumQuotaAlertMessage = getPinnedPremiumQuotaErrorMessage(error);
|
||||||
|
if (premiumQuotaAlertMessage) {
|
||||||
|
console.info("[NewChatPage] Premium quota exhausted:", error);
|
||||||
|
} else {
|
||||||
|
console.error("[NewChatPage] Chat error:", error);
|
||||||
|
}
|
||||||
|
|
||||||
// Track chat error
|
// Track chat error
|
||||||
trackChatError(
|
trackChatError(
|
||||||
|
|
@ -1329,8 +1333,12 @@ export default function NewChatPage() {
|
||||||
if (error instanceof Error && error.name === "AbortError") {
|
if (error instanceof Error && error.name === "AbortError") {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
console.error("[NewChatPage] Resume error:", error);
|
|
||||||
const premiumQuotaAlertMessage = getPinnedPremiumQuotaErrorMessage(error);
|
const premiumQuotaAlertMessage = getPinnedPremiumQuotaErrorMessage(error);
|
||||||
|
if (premiumQuotaAlertMessage) {
|
||||||
|
console.info("[NewChatPage] Premium quota exhausted during resume:", error);
|
||||||
|
} else {
|
||||||
|
console.error("[NewChatPage] Resume error:", error);
|
||||||
|
}
|
||||||
if (premiumQuotaAlertMessage) {
|
if (premiumQuotaAlertMessage) {
|
||||||
setPremiumAlertForThread({
|
setPremiumAlertForThread({
|
||||||
threadId: resumeThreadId,
|
threadId: resumeThreadId,
|
||||||
|
|
@ -1357,6 +1365,7 @@ export default function NewChatPage() {
|
||||||
pendingInterrupt,
|
pendingInterrupt,
|
||||||
messages,
|
messages,
|
||||||
searchSpaceId,
|
searchSpaceId,
|
||||||
|
currentUser?.id,
|
||||||
tokenUsageStore,
|
tokenUsageStore,
|
||||||
toolsWithUI,
|
toolsWithUI,
|
||||||
setPremiumAlertForThread,
|
setPremiumAlertForThread,
|
||||||
|
|
@ -1683,8 +1692,12 @@ export default function NewChatPage() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
batcher.dispose();
|
batcher.dispose();
|
||||||
console.error("[NewChatPage] Regeneration error:", error);
|
|
||||||
const premiumQuotaAlertMessage = getPinnedPremiumQuotaErrorMessage(error);
|
const premiumQuotaAlertMessage = getPinnedPremiumQuotaErrorMessage(error);
|
||||||
|
if (premiumQuotaAlertMessage) {
|
||||||
|
console.info("[NewChatPage] Premium quota exhausted during regeneration:", error);
|
||||||
|
} else {
|
||||||
|
console.error("[NewChatPage] Regeneration error:", error);
|
||||||
|
}
|
||||||
trackChatError(
|
trackChatError(
|
||||||
searchSpaceId,
|
searchSpaceId,
|
||||||
threadId,
|
threadId,
|
||||||
|
|
@ -1717,6 +1730,7 @@ export default function NewChatPage() {
|
||||||
searchSpaceId,
|
searchSpaceId,
|
||||||
messages,
|
messages,
|
||||||
disabledTools,
|
disabledTools,
|
||||||
|
currentUser?.id,
|
||||||
tokenUsageStore,
|
tokenUsageStore,
|
||||||
toolsWithUI,
|
toolsWithUI,
|
||||||
setPremiumAlertForThread,
|
setPremiumAlertForThread,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue