-
Notifications
You must be signed in to change notification settings - Fork 1
Add field to decode error #42
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
WalkthroughThe changes add a new Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant Decoder
Client->>Decoder: Call decodeRecord(input)
Decoder->>Decoder: Detect error during decoding
Decoder->>Decoder: Create DecodeError (includes Field, Column, and Err)
Decoder-->>Client: Return detailed error message
Possibly related PRs
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🔇 Additional comments (15)
✨ Finishing Touches
🪧 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 (
|
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 adds a Field attribute to the DecodeError structure and updates error messages accordingly to improve error information clarity.
- Updates the DecodeError struct to include a new Field string.
- Adjusts the Error() method in decode.go to reflect the new Field attribute.
- Updates tests in decode_test.go to assert that the Field value is correctly set.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
File | Description |
---|---|
decode.go | Adds a Field member to DecodeError and updates error messages to include the field name. |
decode_test.go | Updates tests to verify the new Field value in decode errors. |
Comments suppressed due to low confidence (1)
decode.go:26
- [nitpick] Consider standardizing the error message format in both branches of the Error() method. Currently, one branch uses 'field: "%q"' while the other uses 'field "%q"'; aligning these can improve readability.
return fmt.Sprintf("headercsv: decode error on line %d, column %d, field "%q": %v", e.Line, e.Column, e.Field, e.Err)
Pull Request Test Coverage Report for Build 14099910814Details
💛 - Coveralls |
Summary by CodeRabbit
New Features
Tests