-
Notifications
You must be signed in to change notification settings - Fork 27
Add error correlation ids #116
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
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.
Pull Request Overview
This PR enhances error reporting in the MoQ transport layer by introducing correlation IDs and contextual logging for errors. The changes replace basic error variants (NotFound, Internal, NotImplemented) with new variants that include UUID-based correlation IDs and detailed context messages to facilitate debugging in production.
Key changes:
- Added new error variants with UUID correlation IDs (
NotFoundWithId,InternalWithId,NotImplementedWithId) - Created helper methods (
not_found_ctx,internal_ctx,not_implemented_ctx) that generate correlation IDs and log context with file location - Replaced manual error logging followed by basic error returns with single calls to the new helper methods
Reviewed Changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| moq-transport/src/serve/error.rs | Added three new error variants with UUID correlation IDs and helper methods for creating contextualized errors with automatic logging |
| moq-transport/src/session/error.rs | Updated unimplemented() and From<SessionError> to use new contextualized error helper methods |
| moq-transport/src/session/subscriber.rs | Replaced manual error logging with calls to new error helper methods for not-found and internal errors |
| moq-transport/src/session/publisher.rs | Updated subscription and track status error handling to use contextualized error methods |
| moq-transport/src/session/announce.rs | Updated AnnounceState drop handler to use contextualized error method |
| moq-transport/src/serve/tracks.rs | Updated TracksRequest drop handler to use contextualized error method |
| moq-relay-ietf/src/producer.rs | Updated subscribe and track_status error handling to use contextualized error methods |
| moq-transport/Cargo.toml | Added uuid dependency with v4 feature |
| Cargo.lock | Locked uuid dependency at version 1.18.1 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Establish patterns for sending errors with correlation ids that can be mapped to logs, the same with additional logged information, and the same with custom user-facing reason phrases.
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.
Pull Request Overview
Copilot reviewed 8 out of 9 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Adds a mechanism for correlating user-facing errors to more detailed internal logs with additional context.