-
Notifications
You must be signed in to change notification settings - Fork 36
fix: duplicate error messages in query commands #559
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: duplicate error messages in query commands #559
Conversation
Signed-off-by: Siddhant Khare <Siddhantkhare2694@gmail.com>
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughError handling was adjusted in three query CLI commands to return raw errors instead of wrapping them with additional context. No public APIs or control flows were changed. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Assessment against linked issues
✨ Finishing Touches🧪 Generate unit tests
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:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type 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.
Thanks @Siddhant-K-code! This looks good!
Can I ask you to add a note in the CHANGELOG.md file under unreleased
? We're trying to follow that to make it easier when we end up releasing a new version.
This is only needed for non-chore changes
Later we'll copy this workflow from openfga/openfga so that it errors and we don't have to manually verify
@rhamzeh done, we are good to go :) |
Description
What problem is being solved?
The
fga query list-objects
,fga query list-users
, andfga query list-relations
commands display confusing duplicate error messages like:This makes error messages hard to read and understand for users.
How is it being solved?
By fixing the error handling pattern to match other commands in the codebase:
What changes are made to solve it?
Modified three files to remove duplicate error wrapping:
cmd/query/list-objects.go
- Remove duplicate wrapping in RunE functioncmd/query/list-users.go
- Remove duplicate wrapping in RunE functioncmd/query/list-relations.go
- Remove duplicate wrapping in RunE functionResult: Clean error messages like
Error: failed to list objects due to [actual error]
References
fixes #556
Review Checklist
main
Summary by CodeRabbit
Refactor
User Experience