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

handle req args by parsing and raising #1733

Merged
merged 5 commits into from
Mar 21, 2024

Conversation

ifrit98
Copy link
Contributor

@ifrit98 ifrit98 commented Mar 6, 2024

No description provided.

Copy link

@wolfentensor wolfentensor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The added code is functionally sound and suited for its purpose. One small comment about the exception type.

missing_required_args = self.__check_for_missing_required_args(parser, args)
if missing_required_args:
# Handle missing required arguments gracefully
raise ValueError(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The proper exception to raise is argparse.ArgumentError:

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will not work here because we don't have access the the arg reference.

@ifrit98 ifrit98 merged commit ceb4986 into staging Mar 21, 2024
12 checks passed
@ifrit98 ifrit98 mentioned this pull request Mar 25, 2024
@unconst unconst deleted the feature/handle-required-args-gracefully/phil branch March 27, 2024 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants