Skip to content

Prevent crash and add error console for invalid YAML syntax#5405

Open
shovan-mondal wants to merge 2 commits intolitmuschaos:masterfrom
shovan-mondal:fix/yaml-builder-crash
Open

Prevent crash and add error console for invalid YAML syntax#5405
shovan-mondal wants to merge 2 commits intolitmuschaos:masterfrom
shovan-mondal:fix/yaml-builder-crash

Conversation

@shovan-mondal
Copy link
Contributor

Proposed changes

Fixes a critical issue where the Chaos Studio crashes (White Screen of Death) when typing invalid YAML syntax or modifying template references.
Instead of crashing the application, this PR introduces a robust Error Console that catches parsing errors and displays them safely to the user.

Key Changes:

  • Graceful Error Handling: Wrapped YAML parsing logic (including template referencing) to catch runtime exceptions.
  • New Error Console: Added a dedicated panel below the editor to list syntax/validation errors with line & column numbers.
  • Safety Guard: Automatically disables the Save button when errors are detected to prevent corrupted data or invalid states.
  • Styling: Added ExperimentYamlBuilder.module.scss updates for the error panel.
  • Localization: Added problems string to strings.en.yaml.

Fixes #5404

Types of changes

What types of changes does your code introduce to Litmus? Put an x in the boxes that apply

  • New feature (non-breaking change which adds functionality)
  • Bugfix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices applies)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I have read the CONTRIBUTING doc
  • I have signed the commit for DCO to be passed.
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • I have added necessary documentation (if appropriate)

Dependency

  • None

Special notes for your reviewer:

I have verified this fix manually by reproducing the crash scenario:

  1. Open Chaos Studio YAML editor.
  2. Modify a template name (e.g., change install-chaos-faults to install-chaos-faults-2) to break the reference.
  3. Before: App crashed immediately with TypeError: templates.filter is undefined.
  4. After: App remains stable; Error Console appears at the bottom listing the specific error.

Before the fix:
Screenshot 2026-01-19 123422

After adding a console:

Screenshot 2026-01-19 122528

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.

Chaos Studio crashes on invalid YAML syntax

3 participants