-
Notifications
You must be signed in to change notification settings - Fork 1
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
253 Raise a visible error in the border case where no error message is available #255
base: dev
Are you sure you want to change the base?
Conversation
187c0a4
to
b0c563e
Compare
… message is available
7d57977
to
c8c23f5
Compare
if return_code != 0: | ||
raise KhiopsRuntimeError( | ||
f"{tool_name} execution had errors (return code {return_code}) " | ||
"but no message is available\n" |
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.
Remove the \n
@@ -746,6 +746,13 @@ def _report_exit_status( | |||
f"Khiops ended correctly but there were minor issues:\n{error_msg}" | |||
) | |||
warnings.warn(error_msg.rstrip()) | |||
else: | |||
# no message available, an error must be raised though |
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'd put Raise an exception anyway for a non-zero return code with no messages
False, # ask for an empty stdout | ||
False, # ask for an empty stderr | ||
9, # non-zero error code |
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 can use named parameters to self document:
create_mocked_raw_run(
stdout=False,
stderr=False,
return_code=9
)
Should fix #253