mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-21 14:11:12 -05:00
feat: Implement retry logic for composite submissions
This commit is contained in:
@@ -113,7 +113,12 @@ export const handleError = (
|
||||
p_error_message: errorMessage,
|
||||
p_error_stack: stack,
|
||||
p_user_agent: navigator.userAgent,
|
||||
p_breadcrumbs: JSON.stringify(breadcrumbs),
|
||||
p_breadcrumbs: JSON.stringify({
|
||||
...breadcrumbs,
|
||||
isRetry: context.metadata?.isRetry || false,
|
||||
attempt: context.metadata?.attempt,
|
||||
retriesExhausted: context.metadata?.retriesExhausted || false,
|
||||
}),
|
||||
p_timezone: envContext.timezone,
|
||||
p_referrer: document.referrer || undefined,
|
||||
p_duration_ms: context.duration,
|
||||
@@ -126,11 +131,14 @@ export const handleError = (
|
||||
logger.error('Failed to capture error context', { logError });
|
||||
}
|
||||
|
||||
// Show user-friendly toast with error ID
|
||||
toast.error(context.action, {
|
||||
description: `${errorMessage}\n\nReference ID: ${shortErrorId}`,
|
||||
duration: 5000,
|
||||
});
|
||||
// Show user-friendly toast with error ID (skip for retry attempts)
|
||||
const isRetry = context.metadata?.isRetry === true || context.metadata?.attempt;
|
||||
if (!isRetry) {
|
||||
toast.error(context.action, {
|
||||
description: `${errorMessage}\n\nReference ID: ${shortErrorId}`,
|
||||
duration: 5000,
|
||||
});
|
||||
}
|
||||
|
||||
return errorId;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user