Skip to content

Commit

Permalink
Handle the case in KhiopsRunner::_report_exit_status when the log fil…
Browse files Browse the repository at this point in the history
…e is not available
  • Loading branch information
Thierry RAMORASOAVINA committed Dec 11, 2024
1 parent a2ae7ff commit 3e90f62
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions khiops/core/internals/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -594,17 +594,23 @@ def _report_exit_status(

# Create the message reporting the errors and warnings
error_msg = ""
errors, fatal_errors, warning_messages = self._collect_errors(log_file_path)
if warning_messages:
error_msg += "Warnings in log:\n" + "".join(warning_messages)
if errors:
if error_msg:
error_msg += "\n"
error_msg += "Errors in log:\n" + "".join(errors)
if fatal_errors:
if error_msg:
error_msg += "\n"
error_msg += "Fatal errors in log:\n" + "".join(fatal_errors)
errors = fatal_errors = warning_messages = []
try:
errors, fatal_errors, warning_messages = self._collect_errors(log_file_path)
if warning_messages:
error_msg += "Warnings in log:\n" + "".join(warning_messages)
if errors:
if error_msg:
error_msg += "\n"
error_msg += "Errors in log:\n" + "".join(errors)
if fatal_errors:
if error_msg:
error_msg += "\n"
error_msg += "Fatal errors in log:\n" + "".join(fatal_errors)
# the log file can be missing
# (khiops had not the chance to start)
except:
pass

# Add stdout to the warning message if non empty
if stdout:
Expand Down

0 comments on commit 3e90f62

Please sign in to comment.