-
Notifications
You must be signed in to change notification settings - Fork 346
Fix/log blocked chan #216
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
base: main
Are you sure you want to change the base?
Fix/log blocked chan #216
Conversation
WalkthroughThe update introduces error reporting via hooks for scenarios where notification channels are blocked during notification delivery in the server logic. Specifically, when a notification cannot be sent to a client or all clients due to a full channel, the code now triggers the configured error hook with details about the blocked channel and the relevant method. Additionally, a redundant blank line was removed from an unrelated method. No changes were made to the signatures or declarations of exported or public entities. Changes
Possibly related PRs
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
maybe you could wrap the error as |
…or improved error handling
Thank you for the explanation. I’ve applied it to my code. |
This pull request introduces error handling improvements for blocked notification channels and includes a minor cleanup in the
server/server.go
file. The most significant changes enhance logging and error reporting when notification channels are blocked.Error handling improvements:
func (s *MCPServer) SendNotificationToAllClients
: Added logic to log an error usings.hooks.onError
when a notification channel is blocked, including the session ID and method name in the error message.func (s *MCPServer) SendNotificationToClient
: Enhanced error reporting by logging blocked notification channels withs.hooks.onError
, providing session ID and method details, and returning a descriptive error message.Code cleanup:
func (s *MCPServer) AddResourceTemplate
: Removed an unnecessary blank line for minor code cleanup.Summary by CodeRabbit