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

253 Raise a visible error in the border case where no error message is available #255

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

tramora
Copy link
Collaborator

@tramora tramora commented Oct 9, 2024

Should fix #253

@tramora tramora self-assigned this Oct 9, 2024
@tramora tramora changed the title Raise a visible error in the border case where no error message is available 253 Raise a visible error in the border case where no error message is available Oct 9, 2024
@tramora tramora force-pushed the 253-raise-exception-no-error-message branch from 187c0a4 to b0c563e Compare October 14, 2024 14:18
@tramora tramora force-pushed the 253-raise-exception-no-error-message branch from 7d57977 to c8c23f5 Compare October 14, 2024 14:40
if return_code != 0:
raise KhiopsRuntimeError(
f"{tool_name} execution had errors (return code {return_code}) "
"but no message is available\n"
Copy link
Contributor

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
Copy link
Contributor

@folmos-at-orange folmos-at-orange Oct 18, 2024

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

Comment on lines +2699 to +2701
False, # ask for an empty stdout
False, # ask for an empty stderr
9, # non-zero error code
Copy link
Contributor

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
)

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.

Should raise a visible error in the border case where no error message is available
2 participants