-
Notifications
You must be signed in to change notification settings - Fork 3.9k
fix: cn mcp bugs #8899
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
fix: cn mcp bugs #8899
Changes from all commits
1f44a3d
fa96e30
d045072
63489e9
9e1412c
4ec2b1b
15fb54c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -91,19 +91,32 @@ export function shouldShowExitMessage(): boolean { | |
|
|
||
| // Add global error handlers to prevent uncaught errors from crashing the process | ||
| process.on("unhandledRejection", (reason, promise) => { | ||
| logger.error("Unhandled Rejection at:", { promise, reason }); | ||
| sentryService.captureException( | ||
| reason instanceof Error ? reason : new Error(String(reason)), | ||
| { | ||
| promise: String(promise), | ||
| }, | ||
| ); | ||
| // Extract useful information from the reason | ||
| const errorDetails = { | ||
| promiseString: String(promise), | ||
| reasonType: typeof reason, | ||
| reasonConstructor: reason?.constructor?.name, | ||
| }; | ||
|
|
||
| // If reason is an Error, use it directly for better stack traces | ||
| if (reason instanceof Error) { | ||
| logger.error("Unhandled Promise Rejection", reason, errorDetails); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Passing the Error object into Prompt for AI agents✅ Addressed in |
||
| } else { | ||
| // Convert non-Error reasons to Error for consistent handling | ||
| const error = new Error(`Unhandled rejection: ${String(reason)}`); | ||
| logger.error("Unhandled Promise Rejection", error, { | ||
| ...errorDetails, | ||
| originalReason: String(reason), | ||
| }); | ||
| } | ||
|
|
||
| // Note: Sentry capture is handled by logger.error() above | ||
| // Don't exit the process, just log the error | ||
| }); | ||
|
|
||
| process.on("uncaughtException", (error) => { | ||
| logger.error("Uncaught Exception:", error); | ||
| sentryService.captureException(error); | ||
| // Note: Sentry capture is handled by logger.error() above | ||
| // Don't exit the process, just log the error | ||
| }); | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
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.
Passing the Error into
logger.errorcauses it to callsentryService.captureException, so the explicit capture below now fires twice per rejection, producing duplicate Sentry events.Prompt for AI agents
✅ Addressed in
4ec2b1b