Skip to content

feat(localization): global exception handling restructuring and localization support#2

Merged
EdoTXp merged 19 commits into
mainfrom
feature/localization-for-exceptions
May 27, 2026
Merged

feat(localization): global exception handling restructuring and localization support#2
EdoTXp merged 19 commits into
mainfrom
feature/localization-for-exceptions

Conversation

@EdoTXp

@EdoTXp EdoTXp commented May 27, 2026

Copy link
Copy Markdown
Owner
  • Standardized exceptions across Auth, LocalDatabase, Platform, and RestClient layers.
  • Implemented dynamic localization for all error codes and notification channels.
  • Refactored directory structures and updated imports across multiple feature packages.
  • Updated unit and integration tests to verify localized error string keys.

EdoTXp and others added 19 commits May 20, 2026 10:28
…ndling

- Removed BookException and BookNotFoundException classes.
- Introduced RestClientException to handle various error scenarios.
- Updated GoogleBooksDataSourceImpl, RemoteBooksRepositoryImpl, and DioRestClientImpl to throw RestClientException.
- Modified BookBloc to emit BookErrorState with error codes and messages.
- Updated tests to reflect changes in error handling and exception types.
- Added RestClientErrorCode enum and its extension for localized error messages.
- Added `clearUserData` method to `AuthRepository` and its implementation in `AuthRepositoryImpl`.
- Updated `AuthServiceImpl` to clear user data upon sign-out.
- Modified error handling in `BookBloc` to use `errorDescriptionMessage` instead of `errorMessage`.
- Refactored tests for `AuthServiceImpl` and `ProfileBloc` to accommodate changes in error handling and user data clearing.
- Updated localization message handling in `RestClientErrorCodeExtension`.
- Adjusted various state management classes and events to ensure consistency in error message handling.
- Incremented version number in `pubspec.yaml` to 2.11.1.
- Replaced UserThemeBloc with UserThemeCubit for better state management.
- Introduced UserLoggedCubit to manage user authentication state.
- Added UserNotificationCubit to handle notification initialization.
- Updated BookifyApp to utilize new Cubits for theme, user authentication, and notifications.
- Renamed clearUserData method to deleteUserModel in AuthRepository and its implementation.
- Enhanced AuthService to include userIsLoggedIn method for checking authentication status.
- Updated tests to cover new Cubit implementations and refactored existing tests for clarity.
- Removed obsolete UserThemeBloc test file.
- Bumped version to 2.11.2 in pubspec.yaml.
…ion to 2.11.3

Co-authored-by: Copilot <copilot@github.com>
…n and storage

- Added AuthErrorCode enum to categorize authentication errors.
- Added StorageErrorCode enum to categorize storage-related errors.
- Implemented AuthErrorCodeExtension for localized error messages based on AuthErrorCode.
- Implemented StorageErrorCodeExtension for localized error messages based on StorageErrorCode.
- Updated various test files to utilize new error handling mechanisms, ensuring proper exception handling and message verification.

Co-authored-by: Copilot <copilot@github.com>
- Changed error code from `writeFailed` to `invalidValue` in `user_page_reading_time_repository_impl.dart`.
- Updated error handling in `programming_reading_bloc.dart` to use `StorageErrorCode` for better error categorization.
- Refactored error handling in `reading_page_timer_bloc.dart` and `user_theme_cubit.dart` to utilize `StorageErrorCode` for consistent error messaging.
- Modified state classes in `programming_reading_state.dart` and `reading_page_timer_state.dart` to include error code and description.
- Updated UI components to display localized error messages based on error codes.
- Adjusted localization in `pt_BR.json` for better clarity in user prompts.
- Improved code formatting and readability in various files.
- Bumped version to 2.11.5 in `pubspec.yaml`.
- Correct terms and privacy links in AuthPage
- Simplified error mapping in LocalDatabaseImpl by removing unnecessary checks for specific error types.
- Updated LocalDatabaseErrorCode to include operationFailed and removed unused error codes.
- Modified BookDetailBloc, BookOnBookcaseDetailBloc, BookcaseBloc, and other relevant blocs to use operationFailed for error handling.
- Introduced BookcaseBooksEmptyReason and BookcaseInsertionSuccessReason enums for better state management and localization.
- Updated UI components to reflect changes in state and display localized messages for success and error scenarios.
- Adjusted tests to align with the new state management and localization structure.
- Added NotificationChannelExtension for better localization of channel descriptions and labels.
- Enhanced NotificationsServiceImpl to use localized labels for notification channels.
- Updated ProgrammingReadingBloc to use localized notification titles and bodies.
- Adjusted InsertedHourTimeEvent to include notification title and body.
- Updated ProgrammingReadingPage to pass localized notification messages.
- Updated pubspec.yaml and pubspec.lock for dependency version upgrades.
- Added tests for new notification title and body handling in programming reading bloc.
- Introduced PlatformException class to standardize error handling.
- Added PlatformErrorCode enum for categorizing platform-related errors.
- Enhanced error handling in AppVersionService, ContactsService, LauncherService, NotificationsService, PlayAlarmSoundService, and UserNotificationCubit.
- Updated AboutBloc, ContactsPickerBloc, LoanBloc, LoanDetailBloc, LoanInsertionBloc, NotificationsBloc, and ProgrammingReadingBloc to emit detailed error states.
- Implemented localized error messages using PlatformErrorCodeExtension.
- Updated tests to reflect changes in error handling logic.
- Removed old error code extension files for auth, local database, platform, REST client, and storage errors.
- Created new error code extension files under a unified error code directory structure.
- Updated import paths in various feature files to reflect the new error code structure.
- Modified error handling in the readings timer bloc to utilize the new error code extensions for better localization support.
- Updated tests to check for localized error messages instead of hardcoded strings.
- Bumped version number to 2.11.12 in pubspec.yaml.
Bypass Kotlin JVM target validation in gradle.properties to unblock
the release build. This is a temporary workaround due to an
inconsistency between Java (11) and Kotlin (17) tasks inside the
'flutter_facebook_auth' plugin.

The validation will be re-enabled once the plugin is updated.
@EdoTXp EdoTXp merged commit 9dde7d7 into main May 27, 2026
2 checks passed
@EdoTXp EdoTXp deleted the feature/localization-for-exceptions branch May 27, 2026 14:39
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.

1 participant