Fixup Constant some token exception

This commit is contained in:
Dat H. Pham
2026-03-09 09:02:55 +07:00
committed by Dat H. Pham
parent 437c46f5ff
commit 3e39f59f20
5 changed files with 24 additions and 22 deletions
+1 -1
View File
@@ -71,7 +71,7 @@ class SentryConfig {
const sentryDist = String.fromEnvironment('SENTRY_DIST'); const sentryDist = String.fromEnvironment('SENTRY_DIST');
logTrace( logTrace(
'SentryConfig::load: sentryDist is $sentryDist,' 'SentryConfig::load: sentryDist is $sentryDist, '
'appVersion is $appVersion', 'appVersion is $appVersion',
webConsoleEnabled: true, webConsoleEnabled: true,
); );
@@ -1,84 +1,84 @@
import 'package:core/domain/exceptions/app_base_exception.dart'; import 'package:core/domain/exceptions/app_base_exception.dart';
class NotSupportFCMException extends AppBaseException { class NotSupportFCMException extends AppBaseException {
NotSupportFCMException([super.message]); const NotSupportFCMException([super.message]);
@override @override
String get exceptionName => 'NotSupportFCMException'; String get exceptionName => 'NotSupportFCMException';
} }
class NotLoadedFCMTokenException extends AppBaseException { class NotLoadedFCMTokenException extends AppBaseException {
NotLoadedFCMTokenException([super.message]); const NotLoadedFCMTokenException([super.message]);
@override @override
String get exceptionName => 'NotLoadedFCMTokenException'; String get exceptionName => 'NotLoadedFCMTokenException';
} }
class NotFoundStateToRefreshException extends AppBaseException { class NotFoundStateToRefreshException extends AppBaseException {
NotFoundStateToRefreshException([super.message]); const NotFoundStateToRefreshException([super.message]);
@override @override
String get exceptionName => 'NotFoundStateToRefreshException'; String get exceptionName => 'NotFoundStateToRefreshException';
} }
class NotFoundEmailDeliveryStateException extends AppBaseException { class NotFoundEmailDeliveryStateException extends AppBaseException {
NotFoundEmailDeliveryStateException([super.message]); const NotFoundEmailDeliveryStateException([super.message]);
@override @override
String get exceptionName => 'NotFoundEmailDeliveryStateException'; String get exceptionName => 'NotFoundEmailDeliveryStateException';
} }
class NotFoundFirebaseRegistrationForDeviceException extends AppBaseException { class NotFoundFirebaseRegistrationForDeviceException extends AppBaseException {
NotFoundFirebaseRegistrationForDeviceException([super.message]); const NotFoundFirebaseRegistrationForDeviceException([super.message]);
@override @override
String get exceptionName => 'NotFoundFirebaseRegistrationForDeviceException'; String get exceptionName => 'NotFoundFirebaseRegistrationForDeviceException';
} }
class NotFoundFirebaseRegistrationCacheException extends AppBaseException { class NotFoundFirebaseRegistrationCacheException extends AppBaseException {
NotFoundFirebaseRegistrationCacheException([super.message]); const NotFoundFirebaseRegistrationCacheException([super.message]);
@override @override
String get exceptionName => 'NotFoundFirebaseRegistrationCacheException'; String get exceptionName => 'NotFoundFirebaseRegistrationCacheException';
} }
class NotFoundEmailStateException extends AppBaseException { class NotFoundEmailStateException extends AppBaseException {
NotFoundEmailStateException([super.message]); const NotFoundEmailStateException([super.message]);
@override @override
String get exceptionName => 'NotFoundEmailStateException'; String get exceptionName => 'NotFoundEmailStateException';
} }
class NotFoundNewReceiveEmailException extends AppBaseException { class NotFoundNewReceiveEmailException extends AppBaseException {
NotFoundNewReceiveEmailException([super.message]); const NotFoundNewReceiveEmailException([super.message]);
@override @override
String get exceptionName => 'NotFoundNewReceiveEmailException'; String get exceptionName => 'NotFoundNewReceiveEmailException';
} }
class EmailStateNoChangeException extends AppBaseException { class EmailStateNoChangeException extends AppBaseException {
EmailStateNoChangeException([super.message]); const EmailStateNoChangeException([super.message]);
@override @override
String get exceptionName => 'EmailStateNoChangeException'; String get exceptionName => 'EmailStateNoChangeException';
} }
class NotFoundFirebaseRegistrationCreatedException extends AppBaseException { class NotFoundFirebaseRegistrationCreatedException extends AppBaseException {
NotFoundFirebaseRegistrationCreatedException([super.message]); const NotFoundFirebaseRegistrationCreatedException([super.message]);
@override @override
String get exceptionName => 'NotFoundFirebaseRegistrationCreatedException'; String get exceptionName => 'NotFoundFirebaseRegistrationCreatedException';
} }
class NotFoundFirebaseRegistrationUpdatedException extends AppBaseException { class NotFoundFirebaseRegistrationUpdatedException extends AppBaseException {
NotFoundFirebaseRegistrationUpdatedException([super.message]); const NotFoundFirebaseRegistrationUpdatedException([super.message]);
@override @override
String get exceptionName => 'NotFoundFirebaseRegistrationUpdatedException'; String get exceptionName => 'NotFoundFirebaseRegistrationUpdatedException';
} }
class NotFoundFirebaseRegistrationDestroyedException extends AppBaseException { class NotFoundFirebaseRegistrationDestroyedException extends AppBaseException {
NotFoundFirebaseRegistrationDestroyedException([super.message]); const NotFoundFirebaseRegistrationDestroyedException([super.message]);
@override @override
String get exceptionName => 'NotFoundFirebaseRegistrationDestroyedException'; String get exceptionName => 'NotFoundFirebaseRegistrationDestroyedException';
+1 -1
View File
@@ -9,7 +9,7 @@ abstract class CacheException with EquatableMixin implements Exception {
@override @override
String toString() { String toString() {
if (message != null) { if (message?.trim().isNotEmpty == true) {
return '$exceptionName: $message'; return '$exceptionName: $message';
} }
return exceptionName; return exceptionName;
+6 -4
View File
@@ -112,10 +112,12 @@ class NoNetworkError extends RemoteException {
class RefreshTokenFailedException extends RemoteException { class RefreshTokenFailedException extends RemoteException {
RefreshTokenFailedException({ RefreshTokenFailedException({
super.message = int code = 400,
'Refresh Token failed with 400 Bad Request. The session is invalid/revoked.', Object? message
super.code = 400, }) : super(
}); code: code,
message: message ?? 'Refresh Token failed with 400 Bad Request. The session is invalid/revoked.',
);
@override @override
String get exceptionName => 'RefreshTokenFailedException'; String get exceptionName => 'RefreshTokenFailedException';
@@ -1,28 +1,28 @@
import 'package:core/domain/exceptions/app_base_exception.dart'; import 'package:core/domain/exceptions/app_base_exception.dart';
class AccessTokenIsNullException extends AppBaseException { class AccessTokenIsNullException extends AppBaseException {
AccessTokenIsNullException([super.message]); const AccessTokenIsNullException([super.message]);
@override @override
String get exceptionName => 'AccessTokenIsNullException'; String get exceptionName => 'AccessTokenIsNullException';
} }
class RefreshTokenIsNullException extends AppBaseException { class RefreshTokenIsNullException extends AppBaseException {
RefreshTokenIsNullException([super.message]); const RefreshTokenIsNullException([super.message]);
@override @override
String get exceptionName => 'RefreshTokenIsNullException'; String get exceptionName => 'RefreshTokenIsNullException';
} }
class TokenIdIsNullException extends AppBaseException { class TokenIdIsNullException extends AppBaseException {
TokenIdIsNullException([super.message]); const TokenIdIsNullException([super.message]);
@override @override
String get exceptionName => 'TokenIdIsNullException'; String get exceptionName => 'TokenIdIsNullException';
} }
class ExpiresTimeIsNullException extends AppBaseException { class ExpiresTimeIsNullException extends AppBaseException {
ExpiresTimeIsNullException([super.message]); const ExpiresTimeIsNullException([super.message]);
@override @override
String get exceptionName => 'ExpiresTimeIsNullException'; String get exceptionName => 'ExpiresTimeIsNullException';