-
Notifications
You must be signed in to change notification settings - Fork 1
feat: better error logging #138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughThese changes add client-side and server-side error logging to the chat system. The ChatProvider adds an onError callback for console logging, while the chat route adds stream error handling and structured error responses with detailed error information. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (2)
apps/agentic-chat/src/providers/ChatProvider.tsx (1)
82-89: LGTM! Consider adding error tracking integration.The client-side error logging implementation is solid and provides good debugging visibility. The structured format with message, name, cause, and stack will help diagnose transport and chat errors.
For production monitoring, consider integrating an error tracking service (e.g., Sentry, LogRocket) alongside console logging:
onError: error => { console.error('[Chat Error]', { message: error.message, name: error.name, cause: error.cause, stack: error.stack, }) + // Example: Sentry.captureException(error) },apps/agentic-server/src/routes/chat.ts (1)
262-268: LGTM! Consider structured logging service.The stream error handler correctly captures and logs error details during the streaming phase. The type guards and fallbacks handle various error types appropriately.
For production environments, consider using a structured logging service (e.g., Winston, Pino) instead of console.error:
onError: ({ error }) => { logger.error('[Stream Error]', { message: error instanceof Error ? error.message : String(error), name: error instanceof Error ? error.name : 'Unknown', cause: error instanceof Error ? error.cause : undefined, }) },
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (2)
apps/agentic-chat/src/providers/ChatProvider.tsx(1 hunks)apps/agentic-server/src/routes/chat.ts(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: main
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.