Skip to content
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

Merged
merged 1 commit into from
May 13, 2016

Conversation

JordonPhillips
Copy link
Member

This makes the error message when pagination paramters are passed in
along with --no-paginate more helpful.

cc @kyleknap @jamesls

if not parsed_globals.paginate and \
'PaginationConfig' in call_parameters:
raise PaginationError(message="--no-paginate provided along with "
"pagination arguments.")
Copy link
Contributor

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:

  1. It is weird to have this pagination logic right in the middle of the clidriver
  2. You can have context as to what pagination parameters when they used --no-paginate and thus have a better error message.

@kyleknap
Copy link
Contributor

kyleknap commented May 5, 2016

Had a comment on how to improve the error message and placement of the logic.

@JordonPhillips JordonPhillips force-pushed the really-no-paginate branch 2 times, most recently from 2ba5ce6 to d9f311d Compare May 6, 2016 21:42
@JordonPhillips JordonPhillips added the pr:needs-review This PR needs a review from a Member. label May 6, 2016
@JordonPhillips JordonPhillips force-pushed the really-no-paginate branch 2 times, most recently from da734fc to 4b56085 Compare May 9, 2016 17:50
converted_params = ', '.join(
["--" + p.replace('_', '-') for p in params_used])
raise PaginationError(
message="--no-paginate provided along with pagination "
Copy link
Contributor

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: ...?

@kyleknap
Copy link
Contributor

Looks good. Just had a couple of small comments. Otherwise 🚢

@jamesls
Copy link
Member

jamesls commented May 12, 2016

Looks good to me aside from Kyle's feedback. Putting in incorporating-feedback to track incorporating Kyle's feedback.

@jamesls jamesls added incorporating-feedback and removed pr:needs-review This PR needs a review from a Member. labels May 12, 2016
This makes the error message when pagination paramters are passed in
along with --no-paginate more helpful.
@JordonPhillips JordonPhillips added the pr:needs-review This PR needs a review from a Member. label May 12, 2016
@JordonPhillips
Copy link
Member Author

Updated error message and functional test.

@kyleknap
Copy link
Contributor

Thanks! 🚢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr:needs-review This PR needs a review from a Member.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants