Skip to content

feat: Add centralized ErrorService for consistent error handling#723

Open
TenFinges wants to merge 1 commit intoAOSSIE-Org:devfrom
TenFinges:feature/centralized-error-handling
Open

feat: Add centralized ErrorService for consistent error handling#723
TenFinges wants to merge 1 commit intoAOSSIE-Org:devfrom
TenFinges:feature/centralized-error-handling

Conversation

@TenFinges
Copy link

Description

Added a centralized ErrorService to handle errors consistently across the app. This replaces scattered error handling with a unified approach that provides user-friendly messages, accessibility support, and centralized logging.

Key changes:

  • New ErrorService class with handle() and handleSilently() methods
  • New ErrorType enum for categorizing errors (network, auth, storage, database, validation, general)
  • Added 13 new localization strings for error messages
  • Updated AuthenticationController, RoomsController, and CreateRoomController as pilot implementations

Fixes #722

Type of change

  • New feature (non-breaking change which adds functionality)
  • Refactor (does not change functionality, e.g. code style improvements, linting)

How Has This Been Tested?

  • Added 14 unit tests for ErrorService covering:
    • User-friendly message generation for all error types
    • Appwrite-specific error handling (invalid credentials, user not found, etc.)
    • Silent error handling
flutter test test/services/error_service_test.dart
# 00:02 +14: All tests passed!

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have checked my code and corrected any misspellings

Maintainer Checklist

@TenFinges TenFinges requested a review from M4dhav as a code owner January 15, 2026 15:18
@coderabbitai
Copy link

coderabbitai bot commented Jan 15, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Contributor

🎉 Welcome @TenFinges!
Thank you for your pull request! Our team will review it soon. 🔍

  • Please ensure your PR follows the contribution guidelines. ✅
  • All automated tests should pass before merging. 🔄
  • If this PR fixes an issue, link it in the description. 🔗

We appreciate your contribution! 🚀

@TenFinges
Copy link
Author

Please note that I've added the new error strings in English only. Previous contributors (or any native speakers) could contribute translations for Bengali, Hindi, Gujarati, Kannada, Marathi, and Punjabi.

@M4dhav M4dhav added the enhancement New feature or request label Jan 24, 2026
@M4dhav M4dhav linked an issue Jan 24, 2026 that may be closed by this pull request
Copy link
Contributor

@M4dhav M4dhav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix merge conflicts

@TenFinges TenFinges force-pushed the feature/centralized-error-handling branch from 776ff7f to c6e2639 Compare January 24, 2026 18:17
@TenFinges TenFinges force-pushed the feature/centralized-error-handling branch from c6e2639 to 78904fc Compare January 24, 2026 18:19
@TenFinges TenFinges requested a review from M4dhav January 24, 2026 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add centralized error handling service

2 participants