Skip to content

fix(io-options-dialog): surface JSON parse errors to user via info logger (#842)#879

Merged
EdwardMoyse merged 1 commit intoHSF:mainfrom
deveshbervar:fix/silent-json-parse-error-842
Apr 11, 2026
Merged

fix(io-options-dialog): surface JSON parse errors to user via info logger (#842)#879
EdwardMoyse merged 1 commit intoHSF:mainfrom
deveshbervar:fix/silent-json-parse-error-842

Conversation

@deveshbervar
Copy link
Copy Markdown
Collaborator

Summary

Fixes #842

When a malformed or invalid JSON event file was loaded, Phoenix
crashed silently with no user-facing feedback. The error was only
visible in the browser console.

Changes

Added try/catch blocks around JSON.parse() calls in:

  • handleJSONEventDataInput
  • handleEDM4HEPJSONEventDataInput

Errors are now surfaced via the existing getInfoLogger() mechanism,
consistent with how handleZipEventDataInput and handlePHYSLITEInput
already handle errors.

Before vs After

Before: UI stays completely silent when malformed JSON is loaded

After: User sees clear message in Info Panel:
"Could not parse JSON event file. Please ensure it is valid JSON."

Testing

  • Loaded malformed JSON ({ "broken":) → error shown in Info Panel
  • Loaded valid JSON → loads correctly with no error

@EdwardMoyse EdwardMoyse merged commit a14a8f7 into HSF:main Apr 11, 2026
2 checks passed
@deveshbervar deveshbervar deleted the fix/silent-json-parse-error-842 branch April 11, 2026 15:11
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.

bug: malformed JSON event file causes silent crash with no user feedback

2 participants