refactor(sentry): standardize exceptions to prevent Sentry minification

This commit is contained in:
dab246
2026-02-24 15:40:07 +07:00
committed by Dat H. Pham
parent 296548a781
commit 2e8a11e7eb
75 changed files with 1128 additions and 309 deletions
@@ -1,19 +1,48 @@
import 'package:jmap_dart_client/jmap/core/error/set_error.dart';
import 'package:jmap_dart_client/jmap/core/id.dart';
import 'package:core/domain/exceptions/app_base_exception.dart';
class NotFoundCalendarEventException implements Exception {}
class NotFoundCalendarEventException extends AppBaseException {
NotFoundCalendarEventException([super.message]);
class NotParsableCalendarEventException implements Exception {}
@override
String get exceptionName => 'NotFoundCalendarEventException';
}
class NotAcceptableCalendarEventException implements Exception {}
class NotParsableCalendarEventException extends AppBaseException {
NotParsableCalendarEventException([super.message]);
class NotMaybeableCalendarEventException implements Exception {}
@override
String get exceptionName => 'NotParsableCalendarEventException';
}
class NotRejectableCalendarEventException implements Exception {}
class NotAcceptableCalendarEventException extends AppBaseException {
NotAcceptableCalendarEventException([super.message]);
class CannotReplyCalendarEventException implements Exception {
@override
String get exceptionName => 'NotAcceptableCalendarEventException';
}
class NotMaybeableCalendarEventException extends AppBaseException {
NotMaybeableCalendarEventException([super.message]);
@override
String get exceptionName => 'NotMaybeableCalendarEventException';
}
class NotRejectableCalendarEventException extends AppBaseException {
NotRejectableCalendarEventException([super.message]);
@override
String get exceptionName => 'NotRejectableCalendarEventException';
}
class CannotReplyCalendarEventException extends AppBaseException {
final Map<Id, SetError>? mapErrors;
CannotReplyCalendarEventException({this.mapErrors});
}
CannotReplyCalendarEventException({this.mapErrors})
: super(mapErrors != null ? 'Errors: $mapErrors' : null);
@override
String get exceptionName => 'CannotReplyCalendarEventException';
}
@@ -1,8 +1,29 @@
import 'package:core/domain/exceptions/app_base_exception.dart';
class NotFoundStoredOpenedEmailException implements Exception {}
class NotFoundStoredOpenedEmailException extends AppBaseException {
NotFoundStoredOpenedEmailException([super.message]);
class NotFoundStoredNewEmailException implements Exception {}
@override
String get exceptionName => 'NotFoundStoredOpenedEmailException';
}
class NotFoundStoredEmailException implements Exception {}
class NotFoundStoredNewEmailException extends AppBaseException {
NotFoundStoredNewEmailException([super.message]);
class OpenedEmailAlreadyStoredException implements Exception {}
@override
String get exceptionName => 'NotFoundStoredNewEmailException';
}
class NotFoundStoredEmailException extends AppBaseException {
NotFoundStoredEmailException([super.message]);
@override
String get exceptionName => 'NotFoundStoredEmailException';
}
class OpenedEmailAlreadyStoredException extends AppBaseException {
OpenedEmailAlreadyStoredException([super.message]);
@override
String get exceptionName => 'OpenedEmailAlreadyStoredException';
}
@@ -1,27 +1,70 @@
import 'package:jmap_dart_client/jmap/core/id.dart';
import 'package:core/domain/exceptions/app_base_exception.dart';
class NotFoundEmailException implements Exception {}
class NotFoundEmailException extends AppBaseException {
NotFoundEmailException([super.message]);
class NotFoundEmailContentException implements Exception {}
@override
String get exceptionName => 'NotFoundEmailException';
}
class EmptyEmailContentException implements Exception {}
class NotFoundEmailContentException extends AppBaseException {
NotFoundEmailContentException([super.message]);
class NotFoundEmailRecoveryActionException implements Exception {}
@override
String get exceptionName => 'NotFoundEmailContentException';
}
class NotFoundEmailBlobIdException implements Exception {}
class EmptyEmailContentException extends AppBaseException {
EmptyEmailContentException([super.message]);
class CannotCreateEmailObjectException implements Exception {}
@override
String get exceptionName => 'EmptyEmailContentException';
}
class NotFoundBlobIdException implements Exception {
class NotFoundEmailRecoveryActionException extends AppBaseException {
NotFoundEmailRecoveryActionException([super.message]);
@override
String get exceptionName => 'NotFoundEmailRecoveryActionException';
}
class NotFoundEmailBlobIdException extends AppBaseException {
NotFoundEmailBlobIdException([super.message]);
@override
String get exceptionName => 'NotFoundEmailBlobIdException';
}
class CannotCreateEmailObjectException extends AppBaseException {
CannotCreateEmailObjectException([super.message]);
@override
String get exceptionName => 'CannotCreateEmailObjectException';
}
class NotFoundBlobIdException extends AppBaseException {
final List<Id> ids;
NotFoundBlobIdException(this.ids);
NotFoundBlobIdException(this.ids) : super('Blob IDs: $ids');
@override
String get exceptionName => 'NotFoundBlobIdException';
}
class NotParsableBlobIdToEmailException implements Exception {
class NotParsableBlobIdToEmailException extends AppBaseException {
final List<Id>? ids;
NotParsableBlobIdToEmailException({this.ids});
NotParsableBlobIdToEmailException({this.ids})
: super(ids != null ? 'Blob IDs: $ids' : null);
@override
String get exceptionName => 'NotParsableBlobIdToEmailException';
}
class EmailIdsSuccessIsEmptyException implements Exception {}
class EmailIdsSuccessIsEmptyException extends AppBaseException {
EmailIdsSuccessIsEmptyException([super.message]);
@override
String get exceptionName => 'EmailIdsSuccessIsEmptyException';
}