TF-1115 Implement catch exception for HtmlDataSource
This commit is contained in:
@@ -2,13 +2,15 @@ import 'package:core/core.dart';
|
||||
import 'package:model/model.dart';
|
||||
import 'package:tmail_ui_user/features/email/data/datasource/html_datasource.dart';
|
||||
import 'package:tmail_ui_user/features/email/data/local/html_analyzer.dart';
|
||||
import 'package:tmail_ui_user/main/exceptions/exception_thrower.dart';
|
||||
|
||||
class HtmlDataSourceImpl extends HtmlDataSource {
|
||||
|
||||
final HtmlAnalyzer _htmlAnalyzer;
|
||||
final DioClient _dioClient;
|
||||
final ExceptionThrower _exceptionThrower;
|
||||
|
||||
HtmlDataSourceImpl(this._htmlAnalyzer, this._dioClient);
|
||||
HtmlDataSourceImpl(this._htmlAnalyzer, this._dioClient, this._exceptionThrower);
|
||||
|
||||
@override
|
||||
Future<EmailContent> transformEmailContent(
|
||||
@@ -18,7 +20,7 @@ class HtmlDataSourceImpl extends HtmlDataSource {
|
||||
return Future.sync(() async {
|
||||
return await _htmlAnalyzer.transformEmailContent(emailContent, mapUrlDownloadCID, _dioClient);
|
||||
}).catchError((error) {
|
||||
throw error;
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -27,7 +29,7 @@ class HtmlDataSourceImpl extends HtmlDataSource {
|
||||
return Future.sync(() async {
|
||||
return await _htmlAnalyzer.addTooltipWhenHoverOnLink(emailContent);
|
||||
}).catchError((error) {
|
||||
throw error;
|
||||
_exceptionThrower.throwException(error);
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user