refactor: centralize data connect error handling and resolve build issues across applications
This commit addresses several critical issues across the mobile monorepo:
1. Centralized Error Handling: Integrated DataErrorHandler mixin into all repository implementations, ensuring consistent mapping of Data Connect exceptions to domain AppExceptions.
2. Build Stabilization: Fixed numerous type mismatches, parameter signature errors in widgets (e.g., google_places_flutter itemBuilder), and naming conflicts (StaffSession, FirebaseAuth).
3. Code Quality: Applied 'dart fix' across all modified packages and manually cleared debug print statements and UI clutter.
4. Mono-repo alignment: Standardized Data Connect usage and aliasing ('dc.') for better maintainability.
Signed-off-by: Suriya <suriya@tenext.in>
This commit is contained in:
@@ -304,6 +304,24 @@ class UnknownException extends AppException {
|
||||
String get messageKey => 'errors.generic.unknown';
|
||||
}
|
||||
|
||||
/// Thrown when the server returns an error (500, etc.).
|
||||
class ServerException extends AppException {
|
||||
const ServerException({String? technicalMessage})
|
||||
: super(code: 'SRV_001', technicalMessage: technicalMessage);
|
||||
|
||||
@override
|
||||
String get messageKey => 'errors.generic.server_error';
|
||||
}
|
||||
|
||||
/// Thrown when the service is unavailable (Data Connect down).
|
||||
class ServiceUnavailableException extends AppException {
|
||||
const ServiceUnavailableException({String? technicalMessage})
|
||||
: super(code: 'SRV_002', technicalMessage: technicalMessage);
|
||||
|
||||
@override
|
||||
String get messageKey => 'errors.generic.service_unavailable';
|
||||
}
|
||||
|
||||
/// Thrown when user is not authenticated.
|
||||
class NotAuthenticatedException extends AppException {
|
||||
const NotAuthenticatedException({String? technicalMessage})
|
||||
|
||||
Reference in New Issue
Block a user