Skip to content

fix: generate simulation report on both success and failure#63

Merged
JusterZhu merged 1 commit into
mainfrom
fix/report-always-generate
May 20, 2026
Merged

fix: generate simulation report on both success and failure#63
JusterZhu merged 1 commit into
mainfrom
fix/report-always-generate

Conversation

@JusterZhu
Copy link
Copy Markdown
Collaborator

Generate simulation_report.md in all cases: success, failure, and exception.

Build: 0 errors

Copilot AI review requested due to automatic review settings May 20, 2026 19:09
@JusterZhu JusterZhu merged commit c2502cd into main May 20, 2026
1 check passed
@JusterZhu JusterZhu deleted the fix/report-always-generate branch May 20, 2026 19:11
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the simulation workflow so simulation_report.md is generated not only on successful runs, but also on failures and unexpected exceptions, improving post-run diagnostics.

Changes:

  • Move result logging + report generation outside the success-only branch so failures also produce a report.
  • Add exception handling that attempts to generate a failure report when an exception is thrown.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +112 to +117
{
Status = $"Error: {ex.Message}";
L($"FATAL: {ex}");
var failResult = new SimulationResult { Success = false, ErrorMessage = ex.Message };
var reportPath = await _report.GenerateAsync(Config, failResult, Config.OutputDirectory);
L(_loc.T("Sim.Report", reportPath));
Comment on lines +108 to +117
var reportPath = await _report.GenerateAsync(Config, result, Config.OutputDirectory);
L(_loc.T("Sim.Report", reportPath));
}
catch (Exception ex)
{
Status = $"Error: {ex.Message}";
L($"FATAL: {ex}");
var failResult = new SimulationResult { Success = false, ErrorMessage = ex.Message };
var reportPath = await _report.GenerateAsync(Config, failResult, Config.OutputDirectory);
L(_loc.T("Sim.Report", reportPath));
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