TF-3487 Handle get email content failure

This commit is contained in:
DatDang
2025-02-24 10:37:45 +07:00
committed by Dat H. Pham
parent 91dddff18d
commit 39cea85f86
4 changed files with 122 additions and 6 deletions
@@ -51,5 +51,6 @@ class GetEmailContentFromCacheSuccess extends UIState {
class GetEmailContentFailure extends FeatureFailure {
GetEmailContentFailure(dynamic exception) : super(exception: exception);
GetEmailContentFailure(dynamic exception, {super.onRetry})
: super(exception: exception);
}
@@ -49,7 +49,17 @@ class GetEmailContentInteractor {
}
} catch (e) {
log('GetEmailContentInteractor::execute(): exception = $e');
yield Left<Failure, Success>(GetEmailContentFailure(e));
yield Left<Failure, Success>(GetEmailContentFailure(
e,
onRetry: execute(
session,
accountId,
emailId,
baseDownloadUrl,
transformConfiguration,
additionalProperties: additionalProperties
),
));
}
}
@@ -97,7 +107,17 @@ class GetEmailContentInteractor {
}
} catch (e) {
logError('GetEmailContentInteractor::_getContentEmailFromServer():EXCEPTION: $e');
yield Left<Failure, Success>(GetEmailContentFailure(e));
yield Left<Failure, Success>(GetEmailContentFailure(
e,
onRetry: execute(
session,
accountId,
emailId,
baseDownloadUrl,
transformConfiguration,
additionalProperties: additionalProperties
),
));
}
}