Skip to content

chore: Add better error handling using ErrorPopup#93

Open
ekideno wants to merge 1 commit into
SourcewareLab:devfrom
ekideno:fix/error-handling-issue-63
Open

chore: Add better error handling using ErrorPopup#93
ekideno wants to merge 1 commit into
SourcewareLab:devfrom
ekideno:fix/error-handling-issue-63

Conversation

@ekideno
Copy link
Copy Markdown

@ekideno ekideno commented May 16, 2026

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 #63: utils.ReturnError() is only called from Update() methods, and errors are properly propagated through the call chain.

Fixes #63

@ekideno ekideno requested a review from NucleoFusion as a code owner May 16, 2026 17:06
@ekideno ekideno closed this May 17, 2026
@ekideno ekideno reopened this May 17, 2026
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
@ekideno ekideno force-pushed the fix/error-handling-issue-63 branch from ce25511 to a2dc756 Compare May 17, 2026 18:54
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.

chore: Add better error handling

1 participant