TF-4136 refactor(logging): replace logError with logWarning for non-critical cases

This commit is contained in:
dab246
2026-01-02 12:18:38 +07:00
committed by Dat H. Pham
parent 73dcb6067c
commit a23d15a9ca
160 changed files with 382 additions and 360 deletions
@@ -143,7 +143,7 @@ class DownloadManager {
);
}
} catch (exception) {
logError('DownloadManager::openDownloadedFileWeb(): ERROR: $exception');
logWarning('DownloadManager::openDownloadedFileWeb(): ERROR: $exception');
rethrow;
}
}
@@ -153,7 +153,7 @@ class DownloadManager {
final contentType = responseBody.headers[Headers.contentTypeHeader];
return MediaType.parse(contentType!.first);
} catch (e) {
logError('DownloadManager::_extractMediaTypeFromResponse(): $e');
logWarning('DownloadManager::_extractMediaTypeFromResponse(): $e');
return null;
}
}
@@ -37,7 +37,7 @@ extension StringExtension on String {
}
}
} catch (e) {
logError('StringExtension::firstLetterToUpperCase(): $e');
logWarning('StringExtension::firstLetterToUpperCase(): $e');
return '';
}
}
@@ -94,7 +94,7 @@ extension StringExtension on String {
return 0;
}
} catch (e) {
logError('StringExtension::_generateGradientColorIndex(): $e');
logWarning('StringExtension::_generateGradientColorIndex(): $e');
return 0;
}
}
@@ -26,7 +26,7 @@ extension URIExtension on Uri {
try {
return origin.isNotEmpty;
} catch (e) {
logError('URIExtension::hasOrigin:Exception = $e');
logWarning('URIExtension::hasOrigin:Exception = $e');
return false;
}
}
@@ -46,7 +46,7 @@ abstract class DomTransformer {
return null;
}
} catch (e) {
logError('DomTransformer::findImageUrlFromStyleTag:Exception: $e');
logWarning('DomTransformer::findImageUrlFromStyleTag:Exception: $e');
return null;
}
}
@@ -28,7 +28,7 @@ class AddLazyLoadingForBackgroundImageTransformer extends DomTransformer {
}
}));
} catch (e) {
logError('$runtimeType::process:Exception = $e');
logWarning('$runtimeType::process:Exception = $e');
}
}
}
@@ -36,7 +36,7 @@ class BlockCodeTransformer extends DomTransformer {
''';
}));
} catch (e) {
logError('$runtimeType::process:Exception = $e');
logWarning('$runtimeType::process:Exception = $e');
}
}
}
@@ -29,7 +29,7 @@ class BlockQuotedTransformer extends DomTransformer {
''';
}));
} catch (e) {
logError('$runtimeType::process:Exception = $e');
logWarning('$runtimeType::process:Exception = $e');
}
}
}
@@ -27,7 +27,7 @@ class HideDraftSignatureTransformer extends DomTransformer {
signature.attributes['style'] = '$currentStyle; display: none;';
}
} catch (e) {
logError('$runtimeType::process:Exception = $e');
logWarning('$runtimeType::process:Exception = $e');
}
}
}
@@ -52,7 +52,7 @@ class ImageTransformer extends DomTransformer {
}
}));
} catch (e) {
logError('$runtimeType::process:Exception = $e');
logWarning('$runtimeType::process:Exception = $e');
}
}
@@ -48,7 +48,7 @@ class NormalizeLineHeightInStyleTransformer extends DomTransformer {
}
}
} catch (e) {
logError('$runtimeType::process: Exception = $e');
logWarning('$runtimeType::process: Exception = $e');
}
}
}
@@ -23,7 +23,7 @@ class RemoveCollapsedSignatureButtonTransformer extends DomTransformer {
element.remove();
}));
} catch (e) {
logError('$runtimeType::process:Exception = $e');
logWarning('$runtimeType::process:Exception = $e');
}
}
}
@@ -31,7 +31,7 @@ class RemoveLazyLoadingForBackgroundImageTransformer extends DomTransformer {
element.attributes.remove('lazy');
}));
} catch (e) {
logError('$runtimeType::process:Exception = $e');
logWarning('$runtimeType::process:Exception = $e');
}
}
}
@@ -21,7 +21,7 @@ class RemoveLazyLoadingImageTransformer extends DomTransformer {
element.attributes.remove('loading');
}));
} catch (e) {
logError('$runtimeType::process:Exception = $e');
logWarning('$runtimeType::process:Exception = $e');
}
}
}
@@ -26,7 +26,7 @@ class RemoveMaxWidthInImageStyleTransformer extends DomTransformer {
}
}));
} catch (e) {
logError('$runtimeType::process:Exception = $e');
logWarning('$runtimeType::process:Exception = $e');
}
}
}
@@ -22,7 +22,7 @@ class RemoveStyleTagOutsideTransformer extends DomTransformer {
element.remove();
}));
} catch (e) {
logError('$runtimeType::process:Exception = $e');
logWarning('$runtimeType::process:Exception = $e');
}
}
}
@@ -26,7 +26,7 @@ class SanitizeHyperLinkTagInHtmlTransformer extends DomTransformer {
_addNoReferrerForRelProperty(element);
}));
} catch (e) {
logError('$runtimeType::process:Exception = $e');
logWarning('$runtimeType::process:Exception = $e');
}
}
@@ -23,7 +23,7 @@ class RemoveScriptTransformer extends DomTransformer {
scriptElement.remove();
}));
} catch (e) {
logError('$runtimeType::process:Exception = $e');
logWarning('$runtimeType::process:Exception = $e');
}
}
}
@@ -23,7 +23,7 @@ class SignatureTransformer extends DomTransformer {
element.attributes['class'] = 'tmail-signature-blocked';
}));
} catch (e) {
logError('$runtimeType::process:Exception = $e');
logWarning('$runtimeType::process:Exception = $e');
}
}
}
@@ -56,7 +56,7 @@ class SanitizeAutolinkFilter {
log('SanitizeAutolinkFilter::process:htmlTextBuffer = $textSanitized');
return textSanitized;
} catch (e) {
logError('$runtimeType::process:Exception = $e');
logWarning('$runtimeType::process:Exception = $e');
return inputText;
}
}
@@ -24,7 +24,7 @@ class SanitizeUrl {
}
return originalUrl;
} catch (e) {
logError('SanitizeUrl::process:Exception = $e');
logWarning('SanitizeUrl::process:Exception = $e');
return inputText;
}
}
@@ -166,7 +166,7 @@ class _HtmlContentViewerOnWebState extends State<HtmlContentViewerOnWeb>
_handleHyperLinkEvent(data['url']);
}
} catch (e) {
logError('$runtimeType::_handleMessageEvent:Exception = $e');
logWarning('$runtimeType::_handleMessageEvent:Exception = $e');
}
}
@@ -212,7 +212,7 @@ class _HtmlContentViewerOnWebState extends State<HtmlContentViewerOnWeb>
}
}
} catch (e) {
logError('$runtimeType::_handleIframeOnScrollChangedListener:Exception = $e');
logWarning('$runtimeType::_handleIframeOnScrollChangedListener:Exception = $e');
}
}
@@ -309,7 +309,7 @@ class _HtmlContentViewerOnWebState extends State<HtmlContentViewerOnWeb>
log('$runtimeType::_handleOnIFrameKeyboardEvent:📥 Shortcut pressed: $shortcut');
widget.onIFrameKeyboardShortcutAction?.call(shortcut);
} catch (e) {
logError('$runtimeType::_handleOnIFrameKeyboardEvent: Exception = $e');
logWarning('$runtimeType::_handleOnIFrameKeyboardEvent: Exception = $e');
}
}
@@ -323,7 +323,7 @@ class _HtmlContentViewerOnWebState extends State<HtmlContentViewerOnWeb>
log('$runtimeType::_handleOnIFrameClickEvent: $data');
widget.onIFrameClickAction?.call();
} catch (e) {
logError('$runtimeType::_handleOnIFrameClickEvent: Exception = $e');
logWarning('$runtimeType::_handleOnIFrameClickEvent: Exception = $e');
}
}
@@ -354,7 +354,7 @@ class _HtmlContentViewerOnWebState extends State<HtmlContentViewerOnWeb>
}
}
} catch (e) {
logError('$runtimeType::_handleOnIFrameLinkHoverEvent: Exception = $e');
logWarning('$runtimeType::_handleOnIFrameLinkHoverEvent: Exception = $e');
}
}
@@ -363,7 +363,7 @@ class _HtmlContentViewerOnWebState extends State<HtmlContentViewerOnWeb>
log('$runtimeType::_handleOnIFrameLinkOutEvent: $data');
_tooltipOverlay?.hide();
} catch (e) {
logError('$runtimeType::_handleOnIFrameLinkOutEvent: Exception = $e');
logWarning('$runtimeType::_handleOnIFrameLinkOutEvent: Exception = $e');
}
}
@@ -411,7 +411,7 @@ class HtmlContentViewState extends State<HtmlContentViewer> with AutomaticKeepAl
try {
_webViewController.dispose();
} catch (e) {
logError('_HtmlContentViewState:dispose:_webViewController.dispose: $e');
logWarning('_HtmlContentViewState:dispose:_webViewController.dispose: $e');
}
} else {
_webViewController.dispose();
@@ -111,7 +111,7 @@ class QuickSearchSuggestionListState<T, P, R>
try {
return await widget.fetchRecentActionCallback?.call(queryString);
} catch (e) {
logError('SuggestionsListState::_getRecent:Exception = $e');
logWarning('SuggestionsListState::_getRecent:Exception = $e');
return null;
}
}
@@ -120,7 +120,7 @@ class QuickSearchSuggestionListState<T, P, R>
try {
return await widget.contactSuggestionCallback?.call(queryString);
} catch (e) {
logError('SuggestionsListState::_getListContact:Exception = $e');
logWarning('SuggestionsListState::_getListContact:Exception = $e');
return null;
}
}
@@ -129,7 +129,7 @@ class QuickSearchSuggestionListState<T, P, R>
try {
return await widget.suggestionsCallback?.call(queryString);
} catch (e) {
logError('SuggestionsListState::_getListSuggestion:Exception = $e');
logWarning('SuggestionsListState::_getListSuggestion:Exception = $e');
return null;
}
}
+22 -21
View File
@@ -16,7 +16,7 @@ const appLogName = '[TwakeMail]';
String _applyWebColor(Level level, String text) {
switch (level) {
case Level.wtf:
case Level.critical:
return '$ansiRed$ansiBold!!!CRITICAL!!! $text$ansiReset';
case Level.error:
return '$ansiRed$text$ansiReset';
@@ -26,14 +26,14 @@ String _applyWebColor(Level level, String text) {
return '$ansiGreen$text$ansiReset';
case Level.debug:
return '$ansiBlue$text$ansiReset';
case Level.verbose:
case Level.trace:
return text;
}
}
String _applyMobileFormat(Level level, String text) {
switch (level) {
case Level.wtf:
case Level.critical:
return '🔥 CRITICAL: $text';
case Level.error:
return '❌ ERROR: $text';
@@ -43,7 +43,7 @@ String _applyMobileFormat(Level level, String text) {
return '️ INFO: $text';
case Level.debug:
return '🐛 DEBUG: $text';
case Level.verbose:
case Level.trace:
return '🔍 VERBOSE: $text';
}
}
@@ -56,13 +56,22 @@ void _internalLog(
Map<String, dynamic>? extras,
bool webConsoleEnabled = false,
}) {
final shouldPrint = webConsoleEnabled
? PlatformInfo.isWeb
: BuildUtils.isDebugMode;
if (!shouldPrint) {
return;
}
final rawMessage = _buildRawMessage(message, exception, extras, stackTrace);
final formattedMessage = _formatMessage(level, rawMessage);
if (webConsoleEnabled && PlatformInfo.isWeb) {
_printWebConsole(level, formattedMessage);
} else {
_debugPrint(formattedMessage);
// ignore: avoid_print
print('$appLogName $formattedMessage');
}
}
@@ -80,24 +89,16 @@ String _buildRawMessage(
return parts.join(' | ');
}
String _formatMessage(Level level, String raw) {
return PlatformInfo.isWeb
? _applyWebColor(level, raw)
: _applyMobileFormat(level, raw);
}
void _debugPrint(String formatted) {
if (!BuildUtils.isDebugMode) return;
// ignore: avoid_print
print('$appLogName $formatted');
}
void _printWebConsole(Level level, String value) {
switch (level) {
case Level.error:
case Level.wtf:
case Level.critical:
html.window.console.error('$appLogName $value');
break;
case Level.warning:
@@ -107,7 +108,7 @@ void _printWebConsole(Level level, String value) {
html.window.console.info('$appLogName $value');
break;
case Level.debug:
case Level.verbose:
case Level.trace:
html.window.console.debug('$appLogName $value');
break;
}
@@ -130,7 +131,7 @@ void logError(
);
}
void logWTF(
void logCritical(
String? message, {
Object? exception,
StackTrace? stackTrace,
@@ -139,7 +140,7 @@ void logWTF(
}) {
_internalLog(
message,
level: Level.wtf,
level: Level.critical,
exception: exception,
stackTrace: stackTrace,
extras: extras,
@@ -177,13 +178,13 @@ void logDebug(
);
}
void logVerbose(
void logTrace(
String? message, {
bool webConsoleEnabled = false,
}) {
_internalLog(
message,
level: Level.verbose,
level: Level.trace,
webConsoleEnabled: webConsoleEnabled,
);
}
@@ -198,12 +199,12 @@ void log(
);
enum Level {
wtf,
critical,
error,
warning,
info,
debug,
verbose,
trace,
}
// Take from: https://flutter.dev/docs/testing/errors
+1 -1
View File
@@ -35,7 +35,7 @@ class ApplicationManager {
log('ApplicationManager::getUserAgent: $userAgent');
return userAgent;
} catch(e) {
logError('ApplicationManager::getUserAgent: Exception: $e');
logWarning('ApplicationManager::getUserAgent: Exception: $e');
return '';
}
}
+4 -4
View File
@@ -97,7 +97,7 @@ class FileUtils {
log('FileUtils::getFolder(): $folderPath');
return Directory(folderPath);
} catch (e) {
logError('FileUtils::getFolder():EXCEPTION: $e');
logWarning('FileUtils::getFolder():EXCEPTION: $e');
return null;
}
}
@@ -113,7 +113,7 @@ class FileUtils {
log('FileUtils::removeFolder: Remove ${dir.path} success');
}
} catch (e) {
logError('FileUtils::removeFolder():EXCEPTION: $e');
logWarning('FileUtils::removeFolder():EXCEPTION: $e');
}
}
@@ -134,7 +134,7 @@ class FileUtils {
await file.delete();
}
} catch (e) {
logError('$runtimeType::deleteCompressedFileOnMobile: error: $e');
logWarning('$runtimeType::deleteCompressedFileOnMobile: error: $e');
}
}
@@ -144,7 +144,7 @@ class FileUtils {
log('FileUtils::getCharsetFromBytes: FILE_CHARSET = ${decodedResult.charset}');
return decodedResult.charset;
} catch (e) {
logError('FileUtils::getCharsetFromBytes: Exception: $e');
logWarning('FileUtils::getCharsetFromBytes: Exception: $e');
return DEFAULT_CHARSET;
}
}
+5 -5
View File
@@ -671,7 +671,7 @@ class HtmlUtils {
return true;
} catch (e) {
logError('AppUtils::openNewWindowByUrl:Exception = $e');
logWarning('AppUtils::openNewWindowByUrl:Exception = $e');
return false;
}
}
@@ -683,7 +683,7 @@ class HtmlUtils {
titleElements.first.text = title;
}
} catch (e) {
logError('AppUtils::setWindowBrowserTitle:Exception = $e');
logWarning('AppUtils::setWindowBrowserTitle:Exception = $e');
}
}
@@ -691,7 +691,7 @@ class HtmlUtils {
try {
return htmlUnescape.convert(input);
} catch (e) {
logError('HtmlUtils::unescapeHtml:Exception = $e');
logWarning('HtmlUtils::unescapeHtml:Exception = $e');
return input;
}
}
@@ -718,7 +718,7 @@ class HtmlUtils {
log('HtmlUtils::isOldSafari:Version = $version');
return version != null && version < 17;
} catch (e) {
logError('HtmlUtils::isOldSafari:Exception = $e');
logWarning('HtmlUtils::isOldSafari:Exception = $e');
return false;
}
}
@@ -893,7 +893,7 @@ class HtmlUtils {
return container.innerHtml;
} catch (e) {
logError('HtmlUtils::wrapPlainTextLinks:Exception = $e');
logWarning('HtmlUtils::wrapPlainTextLinks:Exception = $e');
return htmlString;
}
}
+1 -1
View File
@@ -70,7 +70,7 @@ class Domain with EquatableMixin {
InternetAddress(value);
return true;
} catch (e) {
logError('Domain::validIPAddress: Exception = $e');
logWarning('Domain::validIPAddress: Exception = $e');
return false;
}
}
+1 -1
View File
@@ -100,7 +100,7 @@ class MailAddress with EquatableMixin {
throw AddressException('No domain found at position ${pos + 1} in "$address"');
}
} catch (e) {
logError('MailAddress::validate: Exception = $e');
logWarning('MailAddress::validate: Exception = $e');
if (e is AddressException) {
rethrow;
} else {
+3 -3
View File
@@ -65,7 +65,7 @@ class PreviewEmlFileUtils {
${listAttachment?.isNotEmpty == true ? _createAttachmentsElement(listAttachment: listAttachment ?? [], titleAttachment: titleAttachment) : ''}
''');
} catch (e) {
logError('PreviewEmlFileUtils::_createEmailElement: Exception = $e');
logWarning('PreviewEmlFileUtils::_createEmailElement: Exception = $e');
return null;
}
}
@@ -78,7 +78,7 @@ class PreviewEmlFileUtils {
</div>
''';
} catch (e) {
logError('PreviewEmlFileUtils::_createRecipientHtmlTag: Exception = $e');
logWarning('PreviewEmlFileUtils::_createRecipientHtmlTag: Exception = $e');
return '';
}
}
@@ -127,7 +127,7 @@ class PreviewEmlFileUtils {
</div>
''';
} catch (e) {
logError('PreviewEmlFileUtils::_createAttachmentsElement: Exception = $e');
logWarning('PreviewEmlFileUtils::_createAttachmentsElement: Exception = $e');
return '';
}
}
+8 -8
View File
@@ -35,7 +35,7 @@ class PrintUtils {
</table>
''');
} catch (e) {
logError('PrintUtils::_createUserInformationElement: Exception = $e');
logWarning('PrintUtils::_createUserInformationElement: Exception = $e');
return null;
}
}
@@ -44,7 +44,7 @@ class PrintUtils {
try {
return Element.html('<hr />');
} catch (e) {
logError('PrintUtils::dividerElement: Exception = $e');
logWarning('PrintUtils::dividerElement: Exception = $e');
return null;
}
}
@@ -63,7 +63,7 @@ class PrintUtils {
</table>
''');
} catch (e) {
logError('PrintUtils::_createSubjectElement: Exception = $e');
logWarning('PrintUtils::_createSubjectElement: Exception = $e');
return null;
}
}
@@ -88,7 +88,7 @@ class PrintUtils {
</table>
''');
} catch (e) {
logError('PrintUtils::_createSenderElement: Exception = $e');
logWarning('PrintUtils::_createSenderElement: Exception = $e');
return null;
}
}
@@ -99,7 +99,7 @@ class PrintUtils {
element.text = '$prefix: $emailAddress';
return element.outerHtml;
} catch (e) {
logError('PrintUtils::_createRecipientHtmlTag: Exception = $e');
logWarning('PrintUtils::_createRecipientHtmlTag: Exception = $e');
return '';
}
}
@@ -126,7 +126,7 @@ class PrintUtils {
</tr>
''');
} catch (e) {
logError('PrintUtils::_createRecipientsElement: Exception = $e');
logWarning('PrintUtils::_createRecipientsElement: Exception = $e');
return null;
}
}
@@ -147,7 +147,7 @@ class PrintUtils {
</tr>
''');
} catch (e) {
logError('PrintUtils::_createEmailContentElement: Exception = $e');
logWarning('PrintUtils::_createEmailContentElement: Exception = $e');
return null;
}
}
@@ -198,7 +198,7 @@ class PrintUtils {
</table>
''');
} catch (e) {
logError('PrintUtils::_createAttachmentsElement: Exception = $e');
logWarning('PrintUtils::_createAttachmentsElement: Exception = $e');
return null;
}
}
+3 -3
View File
@@ -51,7 +51,7 @@ class StringConvert {
try {
return utf8.decode(base64Decode(text));
} catch (e) {
logError('StringConvert::decodeBase64ToString:Exception = $e');
logWarning('StringConvert::decodeBase64ToString:Exception = $e');
return text;
}
}
@@ -136,7 +136,7 @@ class StringConvert {
log('StringConvert::getMediaTypeFromBase64ImageTag:mimeType = $mimeType');
return MediaType.parse(mimeType);
} catch (e) {
logError('StringConvert::getMimeTypeFromBase64ImageTag:Exception = $e');
logWarning('StringConvert::getMimeTypeFromBase64ImageTag:Exception = $e');
return null;
}
}
@@ -147,7 +147,7 @@ class StringConvert {
final contentOriginal = emailDocument.body?.innerHtml ?? content;
return contentOriginal;
} catch (e) {
logError('StringConvert::getContentOriginal:Exception = $e');
logWarning('StringConvert::getContentOriginal:Exception = $e');
return content;
}
}
+1 -1
View File
@@ -82,7 +82,7 @@ class WebLinkGenerator {
searchParams: searchParams,
);
} catch (e) {
logError('[WebLinkGenerator] Error: $e');
logWarning('[WebLinkGenerator] Error: $e');
return '';
}
}
@@ -207,7 +207,7 @@ mixin ScenarioUtilsMixin {
attachments.add(attachment);
}
} catch (e) {
logError('ScenarioUtilsMixin::uploadAttachments(): $e');
logWarning('ScenarioUtilsMixin::uploadAttachments(): $e');
return attachments;
}
}
+17 -14
View File
@@ -143,7 +143,7 @@ abstract class BaseController extends GetxController
}
void onError(dynamic error, StackTrace stackTrace) {
logError('$runtimeType::onError():Error: $error | StackTrace: $stackTrace');
logWarning('$runtimeType::onError():Error: $error | StackTrace: $stackTrace');
final isUrgentException = validateUrgentException(error);
if (isUrgentException) {
handleUrgentException(exception: error);
@@ -173,7 +173,7 @@ abstract class BaseController extends GetxController
}
void handleUrgentExceptionOnMobile({Failure? failure, Exception? exception}) {
logError('$runtimeType::handleUrgentExceptionOnMobile():Failure: $failure | Exception: $exception');
logWarning('$runtimeType::handleUrgentExceptionOnMobile():Failure: $failure | Exception: $exception');
if (exception is ConnectionError) {
_handleConnectionErrorException();
} else if (exception is BadCredentialsException) {
@@ -182,7 +182,7 @@ abstract class BaseController extends GetxController
}
void handleUrgentExceptionOnWeb({Failure? failure, Exception? exception}) {
logError('$runtimeType::handleUrgentExceptionOnWeb():Failure: $failure | Exception: $exception');
logWarning('$runtimeType::handleUrgentExceptionOnWeb():Failure: $failure | Exception: $exception');
if (exception is NoNetworkError) {
_handleNotNetworkErrorException();
} else if (exception is ConnectionError) {
@@ -258,7 +258,7 @@ abstract class BaseController extends GetxController
}
void handleFailureViewState(Failure failure) async {
logError('$runtimeType::handleFailureViewState():Failure = $failure');
logWarning('$runtimeType::handleFailureViewState():Failure = $failure');
if (failure is LogoutOidcFailure) {
if (_isFcmEnabled) {
_getStoredFirebaseRegistrationFromCache();
@@ -313,7 +313,7 @@ abstract class BaseController extends GetxController
requireCapability(session!, accountId!, [tmailContactCapabilityIdentifier]);
TMailAutoCompleteBindings().dependencies();
} catch (e) {
logError('$runtimeType::injectAutoCompleteBindings(): exception: $e');
logWarning('$runtimeType::injectAutoCompleteBindings(): exception: $e');
}
}
@@ -322,7 +322,7 @@ abstract class BaseController extends GetxController
requireCapability(session!, accountId!, [CapabilityIdentifier.jmapMdn]);
MdnInteractorBindings().dependencies();
} catch(e) {
logError('$runtimeType::injectMdnBindings(): exception: $e');
logWarning('$runtimeType::injectMdnBindings(): exception: $e');
}
}
@@ -331,7 +331,7 @@ abstract class BaseController extends GetxController
requireCapability(session!, accountId!, [capabilityForward]);
ForwardingInteractorsBindings().dependencies();
} catch(e) {
logError('$runtimeType::injectForwardBindings(): exception: $e');
logWarning('$runtimeType::injectForwardBindings(): exception: $e');
}
}
@@ -340,7 +340,7 @@ abstract class BaseController extends GetxController
requireCapability(session!, accountId!, [capabilityRuleFilter]);
EmailRulesInteractorBindings().dependencies();
} catch(e) {
logError('$runtimeType::injectRuleFilterBindings(): exception: $e');
logWarning('$runtimeType::injectRuleFilterBindings(): exception: $e');
}
}
@@ -362,7 +362,7 @@ abstract class BaseController extends GetxController
throw NotSupportFCMException();
}
} catch(e) {
logError('$runtimeType::injectFCMBindings(): exception: $e');
logWarning('$runtimeType::injectFCMBindings(): exception: $e');
}
}
@@ -386,7 +386,7 @@ abstract class BaseController extends GetxController
WebSocketInteractorBindings().dependencies();
WebSocketController.instance.initialize(accountId: accountId, session: session);
} catch(e) {
logError('$runtimeType::injectWebSocket(): exception: $e');
logWarning('$runtimeType::injectWebSocket(): exception: $e');
}
}
@@ -491,7 +491,7 @@ abstract class BaseController extends GetxController
onSuccessCallback();
}
} catch (e) {
logError('BaseController::logoutToSignInNewAccount:Exception = $e');
logWarning('BaseController::logoutToSignInNewAccount:Exception = $e');
onFailureCallback();
}
}
@@ -510,8 +510,11 @@ abstract class BaseController extends GetxController
}
Future<void> _handleDeleteFCMRegistration() async {
_getStoredFirebaseRegistrationInteractor =
getBinding<GetStoredFirebaseRegistrationInteractor>();
if (_getStoredFirebaseRegistrationInteractor == null) return;
try {
_getStoredFirebaseRegistrationInteractor = getBinding<GetStoredFirebaseRegistrationInteractor>();
final fcmRegistration = await _getStoredFirebaseRegistrationInteractor?.execute().last;
fcmRegistration?.foldSuccess<GetStoredFirebaseRegistrationSuccess>(
@@ -522,7 +525,7 @@ abstract class BaseController extends GetxController
onFailure: (failure) {},
);
} catch (e) {
logError('BaseController::_handleDeleteFCMRegistration:Exception = $e');
logWarning('BaseController::_handleDeleteFCMRegistration:Exception = $e');
}
}
@@ -563,7 +566,7 @@ abstract class BaseController extends GetxController
await _clearBasicAuthData();
}
} catch (e) {
logError('BaseController::clearAllData:Exception = $e');
logWarning('BaseController::clearAllData:Exception = $e');
}
}
@@ -19,6 +19,6 @@ class BeforeReconnectManager {
Future<void> executeBeforeReconnectListeners() async {
await Future.wait(_listeners.map((listener) => listener.call()))
.onError((error, stackTrace) => [logError(error.toString())]);
.onError((error, stackTrace) => [logWarning(error.toString())]);
}
}
@@ -21,7 +21,7 @@ abstract class IsolateManager {
IsolateNameServer.registerPortWithName(_eventReceivePort.sendPort, isolateIdentityName);
_streamSubscription = _eventReceivePort.listen(onData, onError: onError, onDone: onDone);
} catch (e) {
logError('IsolateManager::initial():EXCEPTION: $e');
logWarning('IsolateManager::initial():EXCEPTION: $e');
}
}
@@ -32,10 +32,10 @@ abstract class IsolateManager {
if (sendPort != null) {
sendPort.send(value);
} else {
logError('IsolateManager::addEvent(): sendPort is null');
logWarning('IsolateManager::addEvent(): sendPort is null');
}
} catch (e) {
logError('IsolateManager::addEvent():EXCEPTION: $e');
logWarning('IsolateManager::addEvent():EXCEPTION: $e');
}
}
@@ -42,7 +42,7 @@ mixin HandleSetErrorMixin {
handlers!.firstWhere((handler) => handler.call(setError));
return const None<MapEntry<Id, SetError>>();
} catch (e) {
logError('HandleSetErrorMixin::chainHandle(): [Exception] $e');
logWarning('HandleSetErrorMixin::chainHandle(): [Exception] $e');
return Some<MapEntry<Id, SetError>>(setError);
}
}
@@ -50,7 +50,7 @@ mixin HandleSetErrorMixin {
void _handleRemainedError(SetMethodErrorHandler? unCatchErrorHandler, Option<MapEntry<Id, SetError>> optionError) {
final remainedError = optionError.toNullable();
if (remainedError != null) {
logError('HandleSetErrorMixin::_handleRemainedError(): $remainedError');
logWarning('HandleSetErrorMixin::_handleRemainedError(): $remainedError');
unCatchErrorHandler?.call(remainedError);
}
}
@@ -73,7 +73,7 @@ mixin HandleSetErrorMixin {
}
);
}
logError('HandleSetErrorMixin::handleSetResponse():remainedErrors: $remainedErrors');
logWarning('HandleSetErrorMixin::handleSetResponse():remainedErrors: $remainedErrors');
return remainedErrors;
}
}
@@ -1,8 +1,8 @@
import 'package:core/utils/app_logger.dart';
import 'package:core/utils/platform_info.dart';
import 'package:core/utils/string_convert.dart';
import 'package:external_app_launcher/external_app_launcher.dart';
import 'package:rich_text_composer/views/commons/logger.dart';
import 'package:url_launcher/url_launcher.dart' as launcher;
mixin LauncherApplicationMixin {
@@ -28,7 +28,7 @@ mixin LauncherApplicationMixin {
await openOtherApplication(uri);
}
} catch (e) {
logError('LauncherApplicationMixin::launchApplication:Exception = $e');
logWarning('LauncherApplicationMixin::launchApplication:Exception = $e');
}
}
@@ -33,13 +33,13 @@ abstract class ReloadableController extends BaseController {
@override
void handleFailureViewState(Failure failure) {
if (isNotSignedIn(failure)) {
logError('$runtimeType::handleFailureViewState():Failure = $failure');
logWarning('$runtimeType::handleFailureViewState():Failure = $failure');
goToLogin();
} else if (failure is GetSessionFailure) {
logError('$runtimeType::handleFailureViewState():Failure = $failure');
logWarning('$runtimeType::handleFailureViewState():Failure = $failure');
handleGetSessionFailure(failure);
} else if (failure is UpdateAccountCacheFailure) {
logError('$runtimeType::handleFailureViewState():Failure = $failure');
logWarning('$runtimeType::handleFailureViewState():Failure = $failure');
_handleUpdateAccountCacheCompleted(
session: failure.session,
apiUrl: failure.apiUrl);
@@ -153,7 +153,7 @@ abstract class ReloadableController extends BaseController {
requireCapability(session!, accountId!, [CapabilityIdentifier.jmapVacationResponse]);
VacationInteractorsBindings().dependencies();
} catch(e) {
logError('$runtimeType::injectVacationBindings(): exception: $e');
logWarning('$runtimeType::injectVacationBindings(): exception: $e');
}
}
@@ -33,7 +33,7 @@ class SessionCacheManager extends CacheManagerInteraction {
await _cacheClient.insertMultipleItem(legacyMapItems);
log('$runtimeType::migrateHiveToIsolatedHive(): ✅ Migrate Hive box "${_cacheClient.tableName}" → IsolatedHive DONE');
} catch (e) {
logError('$runtimeType::migrateHiveToIsolatedHive(): ❌ Migrate Hive box "${_cacheClient.tableName}" → IsolatedHive FAILED, Error: $e');
logWarning('$runtimeType::migrateHiveToIsolatedHive(): ❌ Migrate Hive box "${_cacheClient.tableName}" → IsolatedHive FAILED, Error: $e');
}
}
}
@@ -87,7 +87,7 @@ class RecentLoginUrlCacheManager extends CacheManagerInteraction {
await _recentLoginUrlCacheClient.insertMultipleItem(legacyMapItems);
log('$runtimeType::migrateHiveToIsolatedHive(): ✅ Migrate Hive box "${_recentLoginUrlCacheClient.tableName}" → IsolatedHive DONE');
} catch (e) {
logError('$runtimeType::migrateHiveToIsolatedHive(): ❌ Migrate Hive box "${_recentLoginUrlCacheClient.tableName}" → IsolatedHive FAILED, Error: $e');
logWarning('$runtimeType::migrateHiveToIsolatedHive(): ❌ Migrate Hive box "${_recentLoginUrlCacheClient.tableName}" → IsolatedHive FAILED, Error: $e');
}
}
}
@@ -89,7 +89,7 @@ class RecentLoginUsernameCacheManager extends CacheManagerInteraction {
await _recentLoginUsernameCacheClient.insertMultipleItem(legacyMapItems);
log('$runtimeType::migrateHiveToIsolatedHive(): ✅ Migrate Hive box "${_recentLoginUsernameCacheClient.tableName}" → IsolatedHive DONE');
} catch (e) {
logError('$runtimeType::migrateHiveToIsolatedHive(): ❌ Migrate Hive box "${_recentLoginUsernameCacheClient.tableName}" → IsolatedHive FAILED, Error: $e');
logWarning('$runtimeType::migrateHiveToIsolatedHive(): ❌ Migrate Hive box "${_recentLoginUsernameCacheClient.tableName}" → IsolatedHive FAILED, Error: $e');
}
}
}
@@ -112,7 +112,7 @@ class RecentSearchCacheManager extends CacheManagerInteraction {
await _recentSearchCacheClient.insertMultipleItem(legacyMapItems);
log('$runtimeType::migrateHiveToIsolatedHive(): ✅ Migrate Hive box "${_recentSearchCacheClient.tableName}" → IsolatedHive DONE');
} catch (e) {
logError('$runtimeType::migrateHiveToIsolatedHive(): ❌ Migrate Hive box "${_recentSearchCacheClient.tableName}" → IsolatedHive FAILED, Error: $e');
logWarning('$runtimeType::migrateHiveToIsolatedHive(): ❌ Migrate Hive box "${_recentSearchCacheClient.tableName}" → IsolatedHive FAILED, Error: $e');
}
}
}
@@ -102,7 +102,7 @@ class ComposerRepositoryImpl extends ComposerRepository {
uploadUri: uploadUri,
);
} catch (e) {
logError('ComposerRepositoryImpl::_replaceImageBase64ToImageCID: Exception: $e');
logWarning('ComposerRepositoryImpl::_replaceImageBase64ToImageCID: Exception: $e');
return Future.value(
Tuple2(
emailContent,
@@ -119,7 +119,7 @@ class ComposerRepositoryImpl extends ComposerRepository {
try {
return _htmlDataSource.removeCollapsedExpandedSignatureEffect(emailContent: emailContent);
} catch (e) {
logError('ComposerRepositoryImpl::_removeCollapsedExpandedSignatureEffect: Exception: $e');
logWarning('ComposerRepositoryImpl::_removeCollapsedExpandedSignatureEffect: Exception: $e');
return Future.value(emailContent);
}
}
@@ -129,7 +129,7 @@ class ComposerRepositoryImpl extends ComposerRepository {
try {
return _htmlDataSource.removeStyleLazyLoadDisplayInlineImages(emailContent: emailContent);
} catch (e) {
logError('ComposerRepositoryImpl::removeStyleLazyLoadDisplayInlineImages: Exception: $e');
logWarning('ComposerRepositoryImpl::removeStyleLazyLoadDisplayInlineImages: Exception: $e');
return Future.value(emailContent);
}
}
@@ -68,7 +68,7 @@ class CreateNewAndSaveEmailToDraftsInteractor {
yield dartz.Left<Failure, Success>(GenerateEmailFailure(CannotCreateEmailObjectException()));
}
} catch (e) {
logError('CreateNewAndSaveEmailToDraftsInteractor::execute: Exception: $e');
logWarning('CreateNewAndSaveEmailToDraftsInteractor::execute: Exception: $e');
if (e is UnknownError && e.message is List<SavingEmailToDraftsCanceledException>) {
if (createEmailRequest.draftsEmailId == null) {
yield dartz.Left<Failure, Success>(SaveEmailAsDraftsFailure(SavingEmailToDraftsCanceledException()));
@@ -94,7 +94,7 @@ class CreateNewAndSaveEmailToDraftsInteractor {
);
return emailCreated;
} catch (e) {
logError('CreateNewAndSaveEmailToDraftsInteractor::_createEmailObject: Exception: $e');
logWarning('CreateNewAndSaveEmailToDraftsInteractor::_createEmailObject: Exception: $e');
return null;
}
}
@@ -65,7 +65,7 @@ class CreateNewAndSendEmailInteractor {
yield dartz.Left<Failure, Success>(GenerateEmailFailure(CannotCreateEmailObjectException()));
}
} catch (e) {
logError('CreateNewAndSendEmailInteractor::execute: Exception: $e');
logWarning('CreateNewAndSendEmailInteractor::execute: Exception: $e');
if (e is UnknownError && e.message is List<SendingEmailCanceledException>) {
yield dartz.Left<Failure, Success>(SendEmailFailure(
exception: SendingEmailCanceledException(),
@@ -92,7 +92,7 @@ class CreateNewAndSendEmailInteractor {
final sendingEmailArgument = createEmailRequest.toSendingEmailArguments(emailObject: emailCreated);
return sendingEmailArgument;
} catch (e) {
logError('CreateNewAndSendEmailInteractor::_createEmailObject: Exception: $e');
logWarning('CreateNewAndSendEmailInteractor::_createEmailObject: Exception: $e');
return null;
}
}
@@ -111,7 +111,7 @@ class CreateNewAndSendEmailInteractor {
cancelToken: cancelToken
);
} catch (e) {
logError('CreateNewAndSendEmailInteractor::_deleteOldDraftsEmail: Exception: $e');
logWarning('CreateNewAndSendEmailInteractor::_deleteOldDraftsEmail: Exception: $e');
}
}
}
@@ -504,7 +504,7 @@ class ComposerController extends BaseController
try {
return session.getUploadUri(accountId, jmapUrl: dynamicUrlInterceptors.jmapUrl);
} catch (e) {
logError('ComposerController::_getUploadUriFromSession:Exception = $e');
logWarning('ComposerController::_getUploadUriFromSession:Exception = $e');
return null;
}
}
@@ -860,7 +860,7 @@ class ComposerController extends BaseController
? htmlTextEditor!.removeEditorStartTag()
: '';
} catch (e) {
logError('ComposerController::getContentInEditor:Exception = $e');
logWarning('ComposerController::getContentInEditor:Exception = $e');
return '';
}
}
@@ -1105,12 +1105,12 @@ class ComposerController extends BaseController
resultState: value,
queryString: queryString,
onFailureCallback: (failure) {
logError('ComposerController::getAutoCompleteSuggestion:onFailureCallback: $failure');
logWarning('ComposerController::getAutoCompleteSuggestion:onFailureCallback: $failure');
consumeState(Stream.value(Left(failure)));
},
),
onError: (error) {
logError('ComposerController::getAutoCompleteSuggestion:onError: $error');
logWarning('ComposerController::getAutoCompleteSuggestion:onError: $error');
consumeState(Stream.value(Left(error)));
},
);
@@ -1133,12 +1133,12 @@ class ComposerController extends BaseController
resultState: value,
queryString: queryString,
onFailureCallback: (failure) {
logError('ComposerController::getAutoCompleteSuggestion:onFailureCallback: $failure');
logWarning('ComposerController::getAutoCompleteSuggestion:onFailureCallback: $failure');
consumeState(Stream.value(Left(failure)));
},
),
onError: (error) {
logError('ComposerController::getAutoCompleteSuggestion:onError: $error');
logWarning('ComposerController::getAutoCompleteSuggestion:onError: $error');
consumeState(Stream.value(Left(error)));
},
) ?? <EmailAddress>[];
@@ -1205,11 +1205,11 @@ class ComposerController extends BaseController
uploadUri: uploadUri,
);
} catch (e) {
logError('ComposerController::uploadAttachmentsAction: $e');
logWarning('ComposerController::uploadAttachmentsAction: $e');
uploadController.consumeState(Stream.value(Left(UploadAttachmentFailure(e, pickedFiles[0]))));
}
} else {
logError('ComposerController::uploadAttachmentsAction: SESSION OR ACCOUNT_ID is NULL');
logWarning('ComposerController::uploadAttachmentsAction: SESSION OR ACCOUNT_ID is NULL');
}
}
@@ -1690,7 +1690,7 @@ class ComposerController extends BaseController
try {
baseDownloadUrl = mailboxDashBoardController.sessionCurrent?.getDownloadUrl(jmapUrl: dynamicUrlInterceptors.jmapUrl);
} catch (e) {
logError('ComposerController::_handleUploadInlineSuccess(): $e');
logWarning('ComposerController::_handleUploadInlineSuccess(): $e');
}
final accountId = mailboxDashBoardController.accountId.value;
@@ -2350,7 +2350,7 @@ class ComposerController extends BaseController
String? base64,
required UploadError uploadError
}) {
logError('ComposerController::handleOnPasteImageFailureAction: $uploadError');
logWarning('ComposerController::handleOnPasteImageFailureAction: $uploadError');
if (!context.mounted) return;
appToast.showToastErrorMessage(
@@ -44,10 +44,10 @@ class RichTextMobileTabletController extends GetxController {
maxWidth: maxWidth
);
} else {
logError('RichTextMobileTabletController::insertImageData: path is null');
logWarning('RichTextMobileTabletController::insertImageData: path is null');
}
} catch (e) {
logError('RichTextMobileTabletController::insertImageData:Exception: $e');
logWarning('RichTextMobileTabletController::insertImageData:Exception: $e');
}
}
@@ -300,7 +300,7 @@ class RichTextWebController extends GetxController {
'<img src="${HtmlUtils.convertBase64ToImageResourceData(base64Data: base64Data, mimeType: mimeType)}" data-filename="${platformFile.name}" alt="Image in my signature" style="max-width:${maxWidth != null ? '${maxWidth}px' : '100%'};" data-mimetype="$mimeType"/>'
);
} else {
logError("RichTextWebController::insertImageAsBase64: bytes is null");
logWarning("RichTextWebController::insertImageAsBase64: bytes is null");
}
}
@@ -23,7 +23,7 @@ extension AttachmentDetectionExtension on ComposerController {
return keywords;
}
} catch (e) {
logError('$runtimeType::validateAttachmentReminder:Error $e');
logWarning('$runtimeType::validateAttachmentReminder:Error $e');
return [];
}
}
@@ -1,6 +1,5 @@
import 'package:core/utils/app_logger.dart';
import 'package:html/parser.dart';
import 'package:rich_text_composer/views/commons/logger.dart';
import 'package:tmail_ui_user/features/composer/presentation/composer_controller.dart';
extension SanitizeSignatureInEmailContentExtension on ComposerController {
@@ -19,7 +18,7 @@ extension SanitizeSignatureInEmailContentExtension on ComposerController {
restoringSignatureButton = true;
await applySignature(signature.innerHtml);
} catch (e) {
logError('SanitizeSignatureInEmailContentExtension::restoreCollapsibleSignatureButton:Exception = $e');
logWarning('SanitizeSignatureInEmailContentExtension::restoreCollapsibleSignatureButton:Exception = $e');
}
}
@@ -33,7 +32,7 @@ extension SanitizeSignatureInEmailContentExtension on ComposerController {
synchronizeInitDraftHash = true;
initEmailDraftHash();
} catch (e) {
logError('SanitizeSignatureInEmailContentExtension::synchronizeInitEmailDraftHash:Exception = $e');
logWarning('SanitizeSignatureInEmailContentExtension::synchronizeInitEmailDraftHash:Exception = $e');
}
}
}
@@ -81,7 +81,7 @@ class _SavingMessageDialogViewState extends State<SavingMessageDialogView> {
}
void _handleErrorStream(Object error, StackTrace stackTrace) {
logError('_SavingMessageDialogViewState::_handleErrorStream: Exception = $error');
logWarning('_SavingMessageDialogViewState::_handleErrorStream: Exception = $error');
if (error is UnknownError && error.message is List<SavingEmailToDraftsCanceledException>) {
popBack(result: SaveEmailAsDraftsFailure(SavingEmailToDraftsCanceledException()));
} else {
@@ -77,7 +77,7 @@ class _SavingTemplateDialogViewState extends State<SavingTemplateDialogView> {
}
void _handleErrorStream(Object error, StackTrace stackTrace) {
logError('SavingTemplateDialogView::_handleErrorStream: Exception = $error');
logWarning('SavingTemplateDialogView::_handleErrorStream: Exception = $error');
popBack(result: SaveTemplateEmailFailure(exception: error));
}
@@ -78,7 +78,7 @@ class _SendingMessageDialogViewState extends State<SendingMessageDialogView> {
}
void _handleErrorStream(Object error, StackTrace stackTrace) {
logError('_SendingMessageDialogViewState::_handleErrorStream: Exception = $error');
logWarning('_SendingMessageDialogViewState::_handleErrorStream: Exception = $error');
if (error is UnknownError && error.message is List<SendingEmailCanceledException>) {
popBack(result: SendEmailFailure(exception: SendingEmailCanceledException()));
} else {
@@ -63,7 +63,7 @@ class _PrintDraftDialogViewState extends State<PrintDraftDialogView> {
}
void _handleErrorStream(Object error, StackTrace stackTrace) {
logError('_PrintDraftDialogViewState::_handleErrorStream: Exception = $error');
logWarning('_PrintDraftDialogViewState::_handleErrorStream: Exception = $error');
popBack(result: PrintEmailFailure(exception: error));
}
@@ -318,13 +318,13 @@ class _WebEditorState extends State<WebEditorWidget> with TextSelectionMixin {
_signatureTooltipReady = true;
_signatureTooltipEntry?.markNeedsBuild();
} catch (e) {
logError(
logWarning(
'_WebEditorState::_showTooltipAtPosition:addPostFrameCallback:Exception = $e',
);
}
});
} catch (e) {
logError('_WebEditorState::_showTooltipAtPosition:Exception = $e');
logWarning('_WebEditorState::_showTooltipAtPosition:Exception = $e');
}
}
@@ -77,7 +77,7 @@ class DownloadAllAttachmentsForWebInteractor {
yield Right(DownloadAllAttachmentsForWebSuccess(taskId: taskId));
} catch (e) {
logError('DownloadAllAttachmentsForWebInteractor::execute():EXCEPTION: $e');
logWarning('DownloadAllAttachmentsForWebInteractor::execute():EXCEPTION: $e');
yield Left(DownloadAllAttachmentsForWebFailure(
exception: e,
taskId: taskId,
@@ -87,7 +87,7 @@ class DownloadAndGetHtmlContentFromAttachmentInteractor {
));
}
} catch (e) {
logError('GetHtmlContentFromAttachmentInteractor:exception: $e');
logWarning('GetHtmlContentFromAttachmentInteractor:exception: $e');
yield Left(DownloadAndGetHtmlContentFromAttachmentFailure(
exception: e,
blobId: attachment.blobId,
@@ -61,7 +61,7 @@ class ExportAllAttachmentsInteractor {
yield Right(ExportAllAttachmentsSuccess(result));
} catch (e) {
logError('ExportAllAttachmentsInteractor::execute():EXCEPTION: $e');
logWarning('ExportAllAttachmentsInteractor::execute():EXCEPTION: $e');
yield Left(ExportAllAttachmentsFailure(exception: e));
}
}
@@ -499,7 +499,7 @@ class EmailDataSourceImpl extends EmailDataSource {
return listEmailContent.asHtmlString;
} catch (e) {
logError('EmailDataSourceImpl::_transformEmailContent:Exception = $e');
logWarning('EmailDataSourceImpl::_transformEmailContent:Exception = $e');
return '';
}
}
@@ -87,7 +87,7 @@ class PrintFileDataSourceImpl extends PrintFileDataSource {
return htmlContentTransformed;
} catch (e) {
logError('PrintFileDataSourceImpl::_transformHtmlEmailContent: Exception: $e');
logWarning('PrintFileDataSourceImpl::_transformHtmlEmailContent: Exception: $e');
return '';
}
}
@@ -104,7 +104,7 @@ class HtmlAnalyzer {
return listEventAction;
}
} catch(e) {
logError('HtmlAnalyzer::getListEventAction:Exception: $e');
logWarning('HtmlAnalyzer::getListEventAction:Exception: $e');
return [];
}
}
@@ -205,7 +205,7 @@ class HtmlAnalyzer {
}));
return document.body?.innerHtml ?? emailContent;
} catch (e) {
logError('HtmlAnalyzer::removeCollapsedExpandedSignatureEffect:Exception = $e');
logWarning('HtmlAnalyzer::removeCollapsedExpandedSignatureEffect:Exception = $e');
return emailContent;
}
}
@@ -233,7 +233,7 @@ class HtmlAnalyzer {
log('HtmlAnalyzer::_retrieveAttachmentFromUpload:Attachment = $attachment | taskId = $taskId');
return (attachment, taskId);
} catch (e) {
logError('HtmlAnalyzer::_retrieveAttachmentFromUpload:Exception = $e');
logWarning('HtmlAnalyzer::_retrieveAttachmentFromUpload:Exception = $e');
return null;
}
}
@@ -259,7 +259,7 @@ class HtmlAnalyzer {
}));
return document.body?.innerHtml ?? emailContent;
} catch (e) {
logError('HtmlAnalyzer::removeStyleLazyLoadDisplayInlineImages:Exception = $e');
logWarning('HtmlAnalyzer::removeStyleLazyLoadDisplayInlineImages:Exception = $e');
return emailContent;
}
}
@@ -93,7 +93,7 @@ class CalendarEventAPI {
methodCallId,
GetCalendarEventAttendanceResponse.deserialize);
} catch (e) {
logError('CalendarEventAPI.parse free/busy query error: $e');
logWarning('CalendarEventAPI.parse free/busy query error: $e');
return null;
}
}
@@ -668,7 +668,7 @@ class EmailAPI with HandleSetErrorMixin, MailAPIMixin {
cancelToken: cancelToken
);
} catch (e) {
logError('EmailAPI::updateEmailDrafts: Exception = $e');
logWarning('EmailAPI::updateEmailDrafts: Exception = $e');
}
return emailCreated;
@@ -713,7 +713,7 @@ class EmailAPI with HandleSetErrorMixin, MailAPIMixin {
cancelToken: cancelToken
);
} catch (e) {
logError('EmailAPI::updateEmailTemplate: Exception = $e');
logWarning('EmailAPI::updateEmailTemplate: Exception = $e');
}
return emailCreated;
@@ -84,7 +84,7 @@ class EmailRepositoryImpl extends EmailRepository {
[emailRequest.emailIdAnsweredOrForwarded!],
);
} catch (e) {
logError('EmailRepositoryImpl::sendEmail::markAsAnswered:Exception $e');
logWarning('EmailRepositoryImpl::sendEmail::markAsAnswered:Exception $e');
}
} else if (emailRequest.isEmailForwarded) {
try {
@@ -94,7 +94,7 @@ class EmailRepositoryImpl extends EmailRepository {
[emailRequest.emailIdAnsweredOrForwarded!],
);
} catch (e) {
logError('EmailRepositoryImpl::sendEmail::markAsForwarded:Exception $e');
logWarning('EmailRepositoryImpl::sendEmail::markAsForwarded:Exception $e');
}
}
@@ -126,7 +126,7 @@ class EmailRepositoryImpl extends EmailRepository {
readActions,
);
} catch (e) {
logError('EmailRepositoryImpl::markAsRead:exception $e');
logWarning('EmailRepositoryImpl::markAsRead:exception $e');
}
return result;
@@ -168,7 +168,7 @@ class EmailRepositoryImpl extends EmailRepository {
),
);
} catch (e) {
logError('EmailRepositoryImpl::moveToMailbox:exception $e');
logWarning('EmailRepositoryImpl::moveToMailbox:exception $e');
}
return result;
@@ -198,7 +198,7 @@ class EmailRepositoryImpl extends EmailRepository {
markStarAction
);
} catch (e) {
logError('EmailRepositoryImpl::markAsStar:exception $e');
logWarning('EmailRepositoryImpl::markAsStar:exception $e');
}
return result;
}
@@ -241,7 +241,7 @@ class EmailRepositoryImpl extends EmailRepository {
cancelToken: cancelToken
);
} catch (e) {
logError('EmailRepositoryImpl::saveEmailAsDrafts:exception $e');
logWarning('EmailRepositoryImpl::saveEmailAsDrafts:exception $e');
}
return result;
}
@@ -267,7 +267,7 @@ class EmailRepositoryImpl extends EmailRepository {
cancelToken: cancelToken
);
} catch (e) {
logError('EmailRepositoryImpl::removeEmailDrafts:exception $e');
logWarning('EmailRepositoryImpl::removeEmailDrafts:exception $e');
}
return result;
}
@@ -295,7 +295,7 @@ class EmailRepositoryImpl extends EmailRepository {
oldEmailId,
);
} catch (e) {
logError('EmailRepositoryImpl::updateEmailDrafts:exception $e');
logWarning('EmailRepositoryImpl::updateEmailDrafts:exception $e');
}
return result;
}
@@ -326,7 +326,7 @@ class EmailRepositoryImpl extends EmailRepository {
cancelToken: cancelToken
);
} catch (e) {
logError('EmailRepositoryImpl::saveEmailAsTemplate:exception $e');
logWarning('EmailRepositoryImpl::saveEmailAsTemplate:exception $e');
}
return result;
}
@@ -354,7 +354,7 @@ class EmailRepositoryImpl extends EmailRepository {
oldEmailId,
);
} catch (e) {
logError('EmailRepositoryImpl::updateEmailTemplate:exception $e');
logWarning('EmailRepositoryImpl::updateEmailTemplate:exception $e');
}
return result;
}
@@ -378,7 +378,7 @@ class EmailRepositoryImpl extends EmailRepository {
await emailDataSource[DataSourceType.hiveCache]
!.deleteMultipleEmailsPermanently(session, accountId, result.emailIdsSuccess);
} catch (e) {
logError('EmailRepositoryImpl::deleteMultipleEmailsPermanently:exception $e');
logWarning('EmailRepositoryImpl::deleteMultipleEmailsPermanently:exception $e');
}
return result;
@@ -404,7 +404,7 @@ class EmailRepositoryImpl extends EmailRepository {
emailId,
);
} catch (e) {
logError('EmailRepositoryImpl::deleteEmailPermanently:exception $e');
logWarning('EmailRepositoryImpl::deleteEmailPermanently:exception $e');
}
return result;
@@ -106,7 +106,7 @@ class GetEmailContentInteractor {
));
}
} catch (e) {
logError('GetEmailContentInteractor::_getContentEmailFromServer():EXCEPTION: $e');
logWarning('GetEmailContentInteractor::_getContentEmailFromServer():EXCEPTION: $e');
yield Left<Failure, Success>(GetEmailContentFailure(
e,
onRetry: execute(
@@ -149,7 +149,7 @@ class GetEmailContentInteractor {
)
));
} catch (e) {
logError('GetEmailContentInteractor::_getStoredOpenedEmail():EXCEPTION: $e');
logWarning('GetEmailContentInteractor::_getStoredOpenedEmail():EXCEPTION: $e');
yield* _getStoredNewEmail(
session,
accountId,
@@ -190,7 +190,7 @@ class GetEmailContentInteractor {
)
));
} catch (e) {
logError('GetEmailContentInteractor::_getStoredNewEmail():EXCEPTION: $e');
logWarning('GetEmailContentInteractor::_getStoredNewEmail():EXCEPTION: $e');
yield* _getContentEmailFromServer(
session,
accountId,
@@ -59,7 +59,7 @@ class SaveTemplateEmailInteractor {
yield Right(SaveTemplateEmailSuccess(emailTemplateSaved.id!));
}
} catch (e) {
logError('SaveTemplateEmailInteractor::execute(): $e');
logWarning('SaveTemplateEmailInteractor::execute(): $e');
if (createEmailRequest.templateEmailId != null) {
yield Left(UpdateTemplateEmailFailure(exception: e));
} else {
@@ -76,7 +76,7 @@ class SaveTemplateEmailInteractor {
isTemplate: true);
return emailCreated;
} catch (e) {
logError('CreateNewAndSaveEmailToDraftsInteractor::_createEmailObject: Exception: $e');
logWarning('CreateNewAndSaveEmailToDraftsInteractor::_createEmailObject: Exception: $e');
return null;
}
}
@@ -41,7 +41,7 @@ class StoreListNewEmailInteractor {
await _emailRepository.getStoredNewEmail(session, accountId, detailedEmail.emailId);
return true;
} catch (err) {
logError('StoreNewEmailInteractor::_isNewEmailAlreadyStored():EXCEPTION: $err');
logWarning('StoreNewEmailInteractor::_isNewEmailAlreadyStored():EXCEPTION: $err');
return false;
}
}
@@ -39,7 +39,7 @@ class StoreOpenedEmailInteractor {
await _emailRepository.getStoredOpenedEmail(session, accountId, detailedEmail.emailId);
return true;
} catch (err) {
logError('StoreOpenedEmailInteractor::isOpenedEmailAlreadyStored():EXCEPTION: $err');
logWarning('StoreOpenedEmailInteractor::isOpenedEmailAlreadyStored():EXCEPTION: $err');
return false;
}
}
@@ -482,7 +482,7 @@ class SingleEmailController extends BaseController with AppLoaderMixin {
transformConfiguration
));
} catch (e) {
logError('SingleEmailController::_getEmailContentAction(): $e');
logWarning('SingleEmailController::_getEmailContentAction(): $e');
consumeState(Stream.value(Left(GetEmailContentFailure(
e,
onRetry: e is UnknownUriException
@@ -15,7 +15,7 @@ extension HandleOpenAttachmentListExtension on SingleEmailController {
}) {
final scrollController = threadDetailController?.scrollController;
if (scrollController == null || !scrollController.hasClients) {
logError(
logWarning(
'$runtimeType::jumpToAttachmentList(): scrollController is null');
return;
}
@@ -106,7 +106,7 @@ class EmailUtils {
MailAddress mailAddress = MailAddress.validateAddress(address);
return GetUtils.isEmail(mailAddress.stripDetails().asString()) && mailAddress.asString().isNotEmpty;
} catch(e) {
logError('EmailUtils::isEmailAddressValid: Exception = $e');
logWarning('EmailUtils::isEmailAddressValid: Exception = $e');
return false;
}
}
@@ -137,7 +137,7 @@ class EmailUtils {
return matches.map((match) => match.group(1)!).toList();
} catch (e) {
logError('EmailUtils::extractMailtoLinksFromListPost:Exception = $e');
logWarning('EmailUtils::extractMailtoLinksFromListPost:Exception = $e');
return [];
}
}
@@ -174,7 +174,7 @@ class EmailUtils {
bccMailAddresses: bccMailAddresses
);
} catch (e) {
logError('EmailUtils::extractRecipientsFromListMailtoLink:Exception = $e');
logWarning('EmailUtils::extractRecipientsFromListMailtoLink:Exception = $e');
return (
toMailAddresses: [],
ccMailAddresses: [],
@@ -207,7 +207,7 @@ class EmailUtils {
bccMailAddresses: navigationRouter.bcc ?? [],
);
} catch (e) {
logError('EmailUtils::extractRecipientsFromMailtoLink:Exception = $e');
logWarning('EmailUtils::extractRecipientsFromMailtoLink:Exception = $e');
return (
toMailAddresses: [],
ccMailAddresses: [],
@@ -240,7 +240,7 @@ class EmailUtils {
type: type?.isNotEmpty == true ? MediaType.parse(type!) : null,
);
} catch (e) {
logError('EmailUtils::parsingAttachmentByUri:Exception = $e:');
logWarning('EmailUtils::parsingAttachmentByUri:Exception = $e:');
return null;
}
}
@@ -329,7 +329,7 @@ class EmailUtils {
MailAddress mailAddress = MailAddress.validateAddress(emailAddress);
return mailAddress.domain.asString();
} catch (e) {
logError('EmailUtils::getDomainByEmailAddress:Exception is $e');
logWarning('EmailUtils::getDomainByEmailAddress:Exception is $e');
return '';
}
}
@@ -161,7 +161,7 @@ class _PDFViewerState extends State<PDFViewer> {
previewerOptions: PreviewerOptions(
previewerState: previewerState,
onError: (error) {
logError('_PDFViewerState::build:openData:onError:: $error');
logWarning('_PDFViewerState::build:openData:onError:: $error');
_pdfViewStateNotifier.value = DownloadAttachmentForWebFailure(exception: error);
},
errorMessage: AppLocalizations.of(context).noPreviewAvailable,
@@ -294,7 +294,7 @@ class EmailPreviewerController extends ReloadableController {
),
));
} catch (e) {
logError('EmailPreviewerController::_handleParseEmailByBlobIdSuccess(): $e');
logWarning('EmailPreviewerController::_handleParseEmailByBlobIdSuccess(): $e');
consumeState(Stream.value(Left(PreviewEmailFromEmlFileFailure(e))));
}
}
@@ -336,7 +336,7 @@ class EmailPreviewerController extends ReloadableController {
onReceiveController: _downloadAttachmentStreamController!)
.listen(_handleDownloadAttachmentViewState);
} catch (e) {
logError('EmailPreviewerController::_handleParseEmailByBlobIdSuccess(): $e');
logWarning('EmailPreviewerController::_handleParseEmailByBlobIdSuccess(): $e');
consumeState(Stream.value(Left(DownloadAttachmentForWebFailure(
attachment: attachment,
taskId: attachment.downloadTaskId,
@@ -74,7 +74,7 @@ extension SessionExtensions on Session {
try {
return getOwnEmailAddressOrEmpty().split('@').last;
} catch (e) {
logError('SessionExtensions::internalDomain: Exception: $e');
logWarning('SessionExtensions::internalDomain: Exception: $e');
return '';
}
}
@@ -88,7 +88,7 @@ extension SessionExtensions on Session {
log('SessionExtensions::getMinInputLengthAutocomplete:minInputLength = $minInputLength');
return minInputLength;
} catch (e) {
logError('SessionExtensions::getMinInputLengthAutocomplete():[Exception] $e');
logWarning('SessionExtensions::getMinInputLengthAutocomplete():[Exception] $e');
return null;
}
}
@@ -102,7 +102,7 @@ extension SessionExtensions on Session {
log('SessionExtensions::getContactSupportCapability:contactSupportCapability = $contactSupportCapability');
return contactSupportCapability;
} catch (e) {
logError('SessionExtensions::getContactSupportCapability():[Exception] $e');
logWarning('SessionExtensions::getContactSupportCapability():[Exception] $e');
return null;
}
}
@@ -142,7 +142,7 @@ extension SessionExtensions on Session {
final props = capability?.props[0] as Map<String, dynamic>?;
return props?[subaddressingSupported] ?? false;
} catch (e) {
logError('SessionExtensions::isSubAddressingSupported:Exception = $e');
logWarning('SessionExtensions::isSubAddressingSupported:Exception = $e');
return false;
}
}
@@ -164,7 +164,7 @@ extension SessionExtensions on Session {
log('SessionExtensions::getSaaSAccountCapability:saaSAccountCapability = $saaSAccountCapability');
return saaSAccountCapability;
} catch (e) {
logError('SessionExtensions::getSaaSAccountCapability():[Exception] $e');
logWarning('SessionExtensions::getSaaSAccountCapability():[Exception] $e');
return null;
}
}
@@ -202,7 +202,7 @@ class HomeController extends ReloadableController {
),
);
} catch (e) {
logError('HomeController::_getSessionActionToLogOut:Exception = $e');
logWarning('HomeController::_getSessionActionToLogOut:Exception = $e');
_handleGetSessionFailureToLogOut(authenticationViewStateSuccess);
}
}
@@ -24,7 +24,7 @@ class GetIdentityCacheOnWebInteractor {
yield Right(GetIdentityCacheOnWebSuccess(result));
} catch (exception) {
logError("$runtimeType::execute: $exception");
logWarning("$runtimeType::execute: $exception");
yield Left(GetIdentityCacheOnWebFailure(exception: exception));
}
}
@@ -17,7 +17,7 @@ class RemoveIdentityCacheOnWebInteractor {
yield Right(RemoveIdentityCacheOnWebSuccess());
} catch (exception) {
logError("$runtimeType::execute: $exception");
logWarning("$runtimeType::execute: $exception");
yield Left(RemoveIdentityCacheOnWebFailure(exception: exception));
}
}
@@ -26,7 +26,7 @@ class SaveIdentityCacheOnWebInteractor {
identityCache: identityCache);
yield Right(SaveIdentityCacheOnWebSuccess());
} catch (exception) {
logError("$runtimeType::execute: $exception");
logWarning("$runtimeType::execute: $exception");
yield Left(SaveIdentityCacheOnWebFailure(exception: exception));
}
}
@@ -701,7 +701,7 @@ class IdentityCreatorController extends BaseController with DragDropFileMixin im
);
}
} else {
logError("IdentityCreatorController::pickImage: context is unmounted");
logWarning("IdentityCreatorController::pickImage: context is unmounted");
}
}
@@ -732,7 +732,7 @@ class IdentityCreatorController extends BaseController with DragDropFileMixin im
)
);
} else {
logError("IdentityCreatorController::_insertInlineImage: context is unmounted");
logWarning("IdentityCreatorController::_insertInlineImage: context is unmounted");
}
} else if (publicAssetController != null) {
publicAssetController!.uploadFileToBlob(file);
@@ -747,7 +747,7 @@ class IdentityCreatorController extends BaseController with DragDropFileMixin im
pathContains: IdentityCreatorConstants.prefixCompressedInlineImageTemp);
}
} else {
logError("IdentityCreatorController::_insertInlineImage: Platform not supported");
logWarning("IdentityCreatorController::_insertInlineImage: Platform not supported");
}
}
}
@@ -765,7 +765,7 @@ class IdentityCreatorController extends BaseController with DragDropFileMixin im
isCompressingInlineImage.value = false;
return compressedFile;
} catch (e) {
logError("$runtimeType::_compressFileAction: compress image error: $e");
logWarning("$runtimeType::_compressFileAction: compress image error: $e");
isCompressingInlineImage.value = false;
if (context.mounted) {
appToast.showToastErrorMessage(
@@ -888,7 +888,7 @@ class IdentityCreatorController extends BaseController with DragDropFileMixin im
{String? base64,
required UploadError uploadError}
) {
logError('$runtimeType::onPasteImageFailure: $uploadError');
logWarning('$runtimeType::onPasteImageFailure: $uploadError');
appToast.showToastErrorMessage(
context,
AppLocalizations.of(context).thisImageCannotBePastedIntoTheEditor);
@@ -941,7 +941,7 @@ class IdentityCreatorController extends BaseController with DragDropFileMixin im
)
);
} else {
logError("IdentityCreatorController::_uploadMultipleFilesToPublicAsset: context is unmounted");
logWarning("IdentityCreatorController::_uploadMultipleFilesToPublicAsset: context is unmounted");
}
return;
}
@@ -959,7 +959,7 @@ class IdentityCreatorController extends BaseController with DragDropFileMixin im
}
);
} catch (e) {
logError("IdentityCreatorController::_uploadMultipleFilesToPublicAsset: error: $e");
logWarning("IdentityCreatorController::_uploadMultipleFilesToPublicAsset: error: $e");
}
}
@@ -61,7 +61,7 @@ class AccountCacheManager extends CacheManagerInteraction {
await _accountCacheClient.insertMultipleItem(legacyMapItems);
log('$runtimeType::migrateHiveToIsolatedHive(): ✅ Migrate Hive box "${_accountCacheClient.tableName}" → IsolatedHive DONE');
} catch (e) {
logError('$runtimeType::migrateHiveToIsolatedHive(): ❌ Migrate Hive box "${_accountCacheClient.tableName}" → IsolatedHive FAILED, Error: $e');
logWarning('$runtimeType::migrateHiveToIsolatedHive(): ❌ Migrate Hive box "${_accountCacheClient.tableName}" → IsolatedHive FAILED, Error: $e');
}
}
}
@@ -38,7 +38,7 @@ class AuthenticationInfoCacheManager extends CacheManagerInteraction {
await _authenticationInfoCacheClient.insertMultipleItem(legacyMapItems);
log('$runtimeType::migrateHiveToIsolatedHive(): ✅ Migrate Hive box "${_authenticationInfoCacheClient.tableName}" → IsolatedHive DONE');
} catch (e) {
logError('$runtimeType::migrateHiveToIsolatedHive(): ❌ Migrate Hive box "${_authenticationInfoCacheClient.tableName}" → IsolatedHive FAILED, Error: $e');
logWarning('$runtimeType::migrateHiveToIsolatedHive(): ❌ Migrate Hive box "${_authenticationInfoCacheClient.tableName}" → IsolatedHive FAILED, Error: $e');
}
}
}
@@ -28,7 +28,7 @@ class EncryptionKeyCacheManager extends CacheManagerInteraction {
await _encryptionKeyCacheClient.insertMultipleItem(legacyMapItems);
log('$runtimeType::migrateHiveToIsolatedHive(): ✅ Migrate Hive box "${_encryptionKeyCacheClient.tableName}" → IsolatedHive DONE');
} catch (e) {
logError('$runtimeType::migrateHiveToIsolatedHive(): ❌ Migrate Hive box "${_encryptionKeyCacheClient.tableName}" → IsolatedHive FAILED, Error: $e');
logWarning('$runtimeType::migrateHiveToIsolatedHive(): ❌ Migrate Hive box "${_encryptionKeyCacheClient.tableName}" → IsolatedHive FAILED, Error: $e');
}
}
}
@@ -63,7 +63,7 @@ class OidcConfigurationCacheManager extends CacheManagerInteraction {
await _oidcConfigurationCacheClient.insertMultipleItem(legacyMapItems);
log('$runtimeType::migrateHiveToIsolatedHive(): ✅ Migrate Hive box "${_oidcConfigurationCacheClient.tableName}" → IsolatedHive DONE');
} catch (e) {
logError('$runtimeType::migrateHiveToIsolatedHive(): ❌ Migrate Hive box "${_oidcConfigurationCacheClient.tableName}" → IsolatedHive FAILED, Error: $e');
logWarning('$runtimeType::migrateHiveToIsolatedHive(): ❌ Migrate Hive box "${_oidcConfigurationCacheClient.tableName}" → IsolatedHive FAILED, Error: $e');
}
}
}
@@ -46,7 +46,7 @@ class TokenOidcCacheManager extends CacheManagerInteraction {
await _tokenOidcCacheClient.insertMultipleItem(legacyMapItems);
log('$runtimeType::migrateHiveToIsolatedHive(): ✅ Migrate Hive box "${_tokenOidcCacheClient.tableName}" → IsolatedHive DONE');
} catch (e) {
logError('$runtimeType::migrateHiveToIsolatedHive(): ❌ Migrate Hive box "${_tokenOidcCacheClient.tableName}" → IsolatedHive FAILED, Error: $e');
logWarning('$runtimeType::migrateHiveToIsolatedHive(): ❌ Migrate Hive box "${_tokenOidcCacheClient.tableName}" → IsolatedHive FAILED, Error: $e');
}
}
}
@@ -74,7 +74,7 @@ mixin AuthenticationClientInteractionMixin {
dynamic handleException(dynamic exception) {
if (exception is FlutterAppAuthPlatformException) {
logError('$runtimeType::handleException: ErrorDetails = ${exception.platformErrorDetails.toString()}');
logWarning('$runtimeType::handleException: ErrorDetails = ${exception.platformErrorDetails.toString()}');
final errorCode = exception.platformErrorDetails.error;
if (errorCode != null) {
final oauthErrorCode = OAuthAuthorizationError.fromErrorCode(
@@ -92,7 +92,7 @@ class AuthenticationClientMobile with AuthenticationClientInteractionMixin
throw AccessTokenInvalidException();
}
} catch (e) {
logError('$runtimeType::refreshingTokensOIDC(): $e');
logWarning('$runtimeType::refreshingTokensOIDC(): $e');
throw handleException(e);
}
}
@@ -89,7 +89,7 @@ class AuthenticationClientWeb with AuthenticationClientInteractionMixin
throw AccessTokenInvalidException();
}
} catch (e) {
logError('$runtimeType::refreshingTokensOIDC(): $e');
logWarning('$runtimeType::refreshingTokensOIDC(): $e');
throw handleException(e);
}
}
@@ -70,10 +70,10 @@ class DnsLookupManager {
}
log('$runtimeType::lookupJmapUrl → ⚠️ No records via ${priority.label}, continuing...');
} on TimeoutException catch (_) {
logError(
logWarning(
'$runtimeType::lookupJmapUrl → ⏱️ ${priority.label} lookup timed out');
} catch (error, stack) {
logError(
logWarning(
'$runtimeType::lookupJmapUrl → ❌ ${priority.label} lookup failed: $error, $stack');
}
}
@@ -83,7 +83,7 @@ class AuthorizationInterceptors extends QueuedInterceptorsWrapper {
@override
void onError(DioError err, ErrorInterceptorHandler handler) async {
logError('AuthorizationInterceptors::onError(): DIO_ERROR = $err');
logWarning('AuthorizationInterceptors::onError(): DIO_ERROR = $err');
try {
final requestOptions = err.requestOptions;
final extraInRequest = requestOptions.extra;
@@ -151,8 +151,12 @@ class AuthorizationInterceptors extends QueuedInterceptorsWrapper {
} else {
return super.onError(err, handler);
}
} catch (e) {
logError('AuthorizationInterceptors::onError:Exception: $e');
} catch (e, stackTrace) {
logError(
'AuthorizationInterceptors::onError:Exception: $e',
exception: e,
stackTrace: stackTrace,
);
if (e is ServerError || e is TemporarilyUnavailable) {
return super.onError(
DioError(requestOptions: err.requestOptions, error: e),
@@ -166,14 +170,17 @@ class AuthorizationInterceptors extends QueuedInterceptorsWrapper {
Stream<List<int>>? _getDataUploadRequest(dynamic mapUploadExtra) {
try {
String? filePath = mapUploadExtra[FileUploader.filePathExtraKey];
if (mapUploadExtra is! Map) return null;
final filePath = mapUploadExtra[FileUploader.filePathExtraKey] as String?;
if (filePath?.isNotEmpty == true) {
return File(filePath!).openRead();
} else {
return mapUploadExtra[FileUploader.streamDataExtraKey];
return mapUploadExtra[FileUploader.streamDataExtraKey] as Stream<List<int>>?;
}
} catch(e) {
log('AuthorizationInterceptors::_getDataUploadRequest: Exception = $e');
logWarning(
'AuthorizationInterceptors::_getDataUploadRequest: Exception = $e',
);
return null;
}
}
@@ -24,7 +24,7 @@ class AuthenticateOidcOnBrowserInteractor {
config.scopes);
yield Right<Failure, Success>(AuthenticateOidcOnBrowserSuccess());
} catch (e) {
logError('AuthenticateOidcOnBrowserInteractor::execute(): $e');
logWarning('AuthenticateOidcOnBrowserInteractor::execute(): $e');
yield Left<Failure, Success>(AuthenticateOidcOnBrowserFailure(e));
}
}
@@ -28,7 +28,7 @@ class GetOIDCConfigurationInteractor {
GetOIDCConfigurationSuccess(configWithLoginHint),
);
} catch (e) {
logError('$runtimeType::execute():oidcResponse = ${oidcResponse.runtimeType} | Exception = $e');
logWarning('$runtimeType::execute():oidcResponse = ${oidcResponse.runtimeType} | Exception = $e');
if (oidcResponse is BaseUrlOidcResponse) {
yield Left<Failure, Success>(GetOIDCConfigurationFromBaseUrlFailure(e));
} else {
@@ -53,14 +53,14 @@ class GetTokenOIDCInteractor {
baseUri,
));
} on PlatformException catch (e) {
logError('GetTokenOIDCInteractor::execute(): PlatformException ${e.message} - ${e.stacktrace}');
logWarning('GetTokenOIDCInteractor::execute(): PlatformException ${e.message} - ${e.stacktrace}');
if (NoSuitableBrowserForOIDCException.verifyException(e)) {
yield Left<Failure, Success>(GetTokenOIDCFailure(NoSuitableBrowserForOIDCException()));
} else {
yield Left<Failure, Success>(GetTokenOIDCFailure(e));
}
} catch (e) {
logError('GetTokenOIDCInteractor::execute(): $e');
logWarning('GetTokenOIDCInteractor::execute(): $e');
yield Left<Failure, Success>(GetTokenOIDCFailure(e));
}
}
@@ -43,7 +43,7 @@ class TryGuessingWebFingerInteractor {
yield Right(TryGuessingWebFingerSuccess(firstNonNullResponse));
}
} catch (e) {
logError('$runtimeType::execute(): Exception = $e');
logWarning('$runtimeType::execute(): Exception = $e');
yield Left(TryGuessingWebFingerFailure(exception: e));
}
}
@@ -45,7 +45,7 @@ class UpdateAccountCacheInteractor {
try {
return session.getQualifiedApiUrl(baseUrl: baseUrl);
} catch (e) {
logError('UpdateAccountCacheInteractor::_getQualifiedApiUrl:Exception = $e');
logWarning('UpdateAccountCacheInteractor::_getQualifiedApiUrl:Exception = $e');
return '';
}
}
@@ -224,7 +224,7 @@ class LoginController extends ReloadableController {
@override
void handleUrgentException({Failure? failure, Exception? exception}) {
logError('LoginController::handleUrgentException:Exception: $exception | Failure: $failure');
logWarning('LoginController::handleUrgentException:Exception: $exception | Failure: $failure');
if (failure is CheckOIDCIsAvailableFailure) {
_handleCheckOIDCIsAvailableFailure(failure);
} else if (failure is GetOIDCConfigurationFromBaseUrlFailure) {
@@ -316,7 +316,7 @@ class LoginController extends ReloadableController {
featureFailure = failure;
tryGetOIDCConfigurationFromBaseUrl(_currentBaseUrl!);
} catch (e) {
logError('LoginController::_handleCheckOIDCIsAvailableFailure:Exception = $e');
logWarning('LoginController::_handleCheckOIDCIsAvailableFailure:Exception = $e');
handleOIDCIsNotAvailable(failure);
}
}
@@ -78,7 +78,7 @@ class MailboxRepositoryImpl extends MailboxRepository {
log('MailboxRepositoryImpl::_getAllMailboxFromCache: MAILBOX_CACHED = ${cacheMailboxResponse.mailboxes.length} | STATE_CACHED = ${cacheMailboxResponse.state?.value}');
return cacheMailboxResponse;
} catch (e) {
logError('MailboxRepositoryImpl::_getAllMailboxFromCache: Exception: $e');
logWarning('MailboxRepositoryImpl::_getAllMailboxFromCache: Exception: $e');
return null;
}
}
@@ -106,7 +106,7 @@ class MailboxRepositoryImpl extends MailboxRepository {
await _syncNewMailboxesInCache(accountId, userName, newMailboxes);
await _syncNewMailboxStateInCache(accountId, userName, newState);
} catch (e) {
logError('MailboxRepositoryImpl::_syncNewInCache: Exception = $e');
logWarning('MailboxRepositoryImpl::_syncNewInCache: Exception = $e');
}
}
@@ -220,7 +220,7 @@ class MailboxRepositoryImpl extends MailboxRepository {
await mapDataSource[DataSourceType.local]
!.renameMailbox(session, accountId, request);
} catch (e) {
logError('MailboxRepositoryImpl::renameMailbox: Exception: $e');
logWarning('MailboxRepositoryImpl::renameMailbox: Exception: $e');
}
return result;
@@ -257,7 +257,7 @@ class MailboxRepositoryImpl extends MailboxRepository {
) ?? Future.value(),
]);
} catch (e) {
logError('MailboxRepositoryImpl::markAsMailboxRead: Exception: $e');
logWarning('MailboxRepositoryImpl::markAsMailboxRead: Exception: $e');
}
return result;
}
@@ -60,7 +60,7 @@ class CreateDefaultMailboxInteractor {
);
return mailboxUpdatedRecord.$1;
} catch (e) {
logError('CreateDefaultMailboxInteractor::_updateRoleToListMailbox:Exception = $e');
logWarning('CreateDefaultMailboxInteractor::_updateRoleToListMailbox:Exception = $e');
return mailboxes;
}
}
@@ -49,7 +49,7 @@ class DeleteMultipleMailboxInteractor {
currentMailboxState: currentMailboxState));
}
} catch (e) {
logError('DeleteMultipleMailboxInteractor::execute(): exception: $e');
logWarning('DeleteMultipleMailboxInteractor::execute(): exception: $e');
yield Left<Failure, Success>(DeleteMultipleMailboxFailure(e));
}
}

Some files were not shown because too many files have changed in this diff Show More