chore: Add better error handling using ErrorPopup#93
Open
ekideno wants to merge 1 commit into
Open
Conversation
Refactored error handling across the codebase to use the existing ErrorPopup component via utils.ReturnError() function. This provides a consistent user experience when errors occur in the TUI. Changes: - Updated internal/models files to return errors from Update() methods using utils.ReturnError() which displays errors via ErrorPopup - Modified file operation handlers (create, delete, rename, move) to return errors instead of calling os.Exit(1) - Updated daily task operations (GetItems, WriteItems, handlers) to propagate errors properly - Fixed viewer ReadFile() to return errors instead of printing them - Updated constructors (NewDaily, NewHome, NewFileExplorer) to return errors for proper initialization error handling - Improved CLI commands to return errors using standard Go error handling All error handling now follows the pattern specified in issue SourcewareLab#63: utils.ReturnError() is only called from Update() methods, and errors are properly propagated through the call chain. Fixes SourcewareLab#63
ce25511 to
a2dc756
Compare
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.
Refactored error handling across the codebase to use the existing ErrorPopup component via utils.ReturnError() function. This provides a consistent user experience when errors occur in the TUI.
Changes:
All error handling now follows the pattern specified in issue #63: utils.ReturnError() is only called from Update() methods, and errors are properly propagated through the call chain.
Fixes #63