-
-
Notifications
You must be signed in to change notification settings - Fork 12
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
Add sys.exit(1) on failures #384
base: main
Are you sure you want to change the base?
Conversation
@@ -126,7 +126,8 @@ def main(args): | |||
len(schema_errors), schema_count) | |||
for failure in schema_errors: | |||
logging.error(' %s', failure) | |||
exit(1) | |||
# We need to clobber the process | |||
sys.exit(1) | |||
else: | |||
logging.info("All %d schema are valid in file %s", schema_count, output_filename) | |||
exit(0) |
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.
You didn't change this line. But I wonder if you need it.
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 think sys.exit is appropriate here.
schema/check_generated_data.py
Outdated
else: | ||
logging.info("All %d generated test data files match with schema", schema_count) | ||
exit(0) | ||
sys.exit(0) |
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.
Do you need a sys.exit(0)
? If this is the last line of the happy case, then it reads better to remove the line. When I see sys.exit(<nonzero>)
, I assume that someone is signalling an unnaturally early exit, so a really unhappy case. Happy cases and handled unhappy cases would otherwise be treated "normally" (no op, try/catch exception handling, etc.).
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.
Fixed.
No description provided.