-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Print better error when using pagination params and no paginate #1958
Conversation
e9bf4fe
to
176088b
Compare
if not parsed_globals.paginate and \ | ||
'PaginationConfig' in call_parameters: | ||
raise PaginationError(message="--no-paginate provided along with " | ||
"pagination arguments.") |
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.
I would to prefer to put this logic here for the following reasons:
- It is weird to have this pagination logic right in the middle of the clidriver
- You can have context as to what pagination parameters when they used
--no-paginate
and thus have a better error message.
Had a comment on how to improve the error message and placement of the logic. |
2ba5ce6
to
d9f311d
Compare
da734fc
to
4b56085
Compare
converted_params = ', '.join( | ||
["--" + p.replace('_', '-') for p in params_used]) | ||
raise PaginationError( | ||
message="--no-paginate provided along with pagination " |
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.
We can make the message a tad more explicit such as Cannot specify --no-paginate along with pagination arguments: ...
?
Looks good. Just had a couple of small comments. Otherwise 🚢 |
Looks good to me aside from Kyle's feedback. Putting in incorporating-feedback to track incorporating Kyle's feedback. |
This makes the error message when pagination paramters are passed in along with --no-paginate more helpful.
4b56085
to
12aa790
Compare
Updated error message and functional test. |
Thanks! 🚢 |
This makes the error message when pagination paramters are passed in
along with --no-paginate more helpful.
cc @kyleknap @jamesls