Repository navigation
Better error handling - #20
Merged
Merged
Conversation
alexhroom
force-pushed
the
better-error-handling
branch
from
October 14, 2026 09:26
174af02 to
7d88d37
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Cancellation and rollback paths can produce unintended errors, the popup assertion is ineffective, and the required Dash version is undeclared.
4 open findings
What changed in this PR
Refactors callback failures into a centralized modal with user-friendly messages, tracebacks, and GUI rollback support.
Changes:
- Adds
GUIError, a global Dash error handler, and an error-details modal. - Migrates presenters and callbacks from returned error strings to exceptions.
- Updates unit and system tests for the new behavior.
| File | Description |
|---|---|
src/MNeuEventGUI/utils/errors.py |
Implements centralized error handling and modal UI. |
src/MNeuEventGUI/main_app/view.py |
Registers the handler and modal callbacks. |
src/MNeuEventGUI/main_app/presenter.py |
Converts load/save failures to GUIError. |
src/MNeuEventGUI/table/presenter.py |
Adds table-edit rollback errors. |
src/MNeuEventGUI/table/view.py |
Removes the error-message callback output. |
src/MNeuEventGUI/time/presenter.py |
Raises errors for invalid time edits. |
src/MNeuEventGUI/log/presenter.py |
Raises errors for invalid log edits. |
src/MNeuEventGUI/filters/presenter.py |
Propagates calculation errors globally. |
src/MNeuEventGUI/filters/view.py |
Removes the calculation error output. |
src/MNeuEventGUI/test_helpers/gui.py |
Renames the popup assertion helper. |
tests/utils/errors_test.py |
Tests error details, rollback, and modal updates. |
tests/main_app/main_app_presenter_test.py |
Tests presenter error conversion and rollback. |
tests/table/table_presenter_test.py |
Tests table validation exceptions. |
tests/time/time_presenter_test.py |
Tests time-edit rollback exceptions. |
tests/log/log_presenter_test.py |
Tests log-edit rollback exceptions. |
tests/filters/filters_presenter_test.py |
Updates calculation error expectations. |
tests/system_tests/load_and_save_test.py |
Exercises the error popup and details view. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
👋 Hi, @alexhroom, Conflicts have been detected against the base branch. Please rebase your branch against the base branch. This message is automatically generated by prince-chrismc/label-merge-conflicts-action so don't hesitate to report issues/improvements there. |
| html.Div(id=presenter.ID + '-dropdown-container') | ||
| ]) | ||
|
|
||
| @property |
Co-authored-by: Anthony <anthony.lim@stfc.ac.uk>
AnthonyLim23
approved these changes
Nov 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


This PR refactors error handling to use a global callback error handler rather than passing strings around. When a callback produces an error, there is now a popup (fixes #16).
This PR also adds a
GUIErrorclass which allows errors to both revert parts of the GUI data and also provide a user-friendly message separate to the actual error traceback (which can now be viewed in a 'Show details' tab.This should make our error handling more consistent as all errors are now caught rather than just ones we have a string for, and also the traceback is now available to users so they can report the error to us with more information.