Fix Recent Activity errors

This commit is contained in:
gpt-engineer-app[bot]
2025-11-05 03:53:58 +00:00
parent 5616a4ffe8
commit acfbf872d2
2 changed files with 122 additions and 36 deletions

View File

@@ -35,13 +35,29 @@ export const handleError = (
? error.message
: 'An unexpected error occurred';
// Log to console/monitoring
// Log to console/monitoring with enhanced debugging
const stack = error instanceof Error ? error.stack : undefined;
logger.error('Error occurred', {
...context,
error: error instanceof Error ? error.message : String(error),
stack: error instanceof Error ? error.stack : undefined,
stack,
errorId,
errorType: typeof error,
errorConstructor: error?.constructor?.name,
hasStack: !!stack,
});
// Additional debug logging when stack is missing
if (!stack) {
console.error('[handleError] Error without stack trace:', {
type: typeof error,
constructor: error?.constructor?.name,
error: error,
context,
errorId
});
}
// Log to database with breadcrumbs (non-blocking)
try {