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
@@ -148,7 +148,7 @@ class ThreadAPI with HandleSetErrorMixin, MailAPIMixin {
getSearchSnippetMethodCallId,
SearchSnippetGetResponse.fromJson)?.list;
} catch (e) {
logError('ThreadAPI::searchEmails:getSearchSnippetsFromResponse: Exception = $e');
logWarning('ThreadAPI::searchEmails:getSearchSnippetsFromResponse: Exception = $e');
return null;
}
}
@@ -42,7 +42,7 @@ class GetEmailByIdInteractor {
);
}
} catch (e) {
logError('GetEmailByIdInteractor::execute():EXCEPTION: $e');
logWarning('GetEmailByIdInteractor::execute():EXCEPTION: $e');
yield Left<Failure, Success>(GetEmailByIdFailure(e));
}
}
@@ -62,7 +62,7 @@ class GetEmailByIdInteractor {
GetEmailByIdSuccess(email, mailboxContain: mailboxContain)
);
} catch (e) {
logError('GetEmailByIdInteractor::_getEmailByIdFromServer():EXCEPTION: $e');
logWarning('GetEmailByIdInteractor::_getEmailByIdFromServer():EXCEPTION: $e');
yield Left<Failure, Success>(GetEmailByIdFailure(e));
}
@@ -80,7 +80,7 @@ class GetEmailByIdInteractor {
final email = await _emailRepository.getStoredEmail(session, accountId, emailId);
yield Right<Failure, Success>(GetEmailByIdSuccess(email.toPresentationEmail()));
} catch (e) {
logError('GetEmailByIdInteractor::_tryToGetEmailFromCache():EXCEPTION: $e');
logWarning('GetEmailByIdInteractor::_tryToGetEmailFromCache():EXCEPTION: $e');
yield* _getEmailByIdFromServer(session, accountId, emailId, properties: properties);
}
}
@@ -222,7 +222,7 @@ class ThreadController extends BaseController with EmailActionController {
@override
void handleErrorViewState(Object error, StackTrace stackTrace) {
super.handleErrorViewState(error, stackTrace);
logError('ThreadController::handleErrorViewState(): error: $error | stackTrace: $stackTrace');
logWarning('ThreadController::handleErrorViewState(): error: $error | stackTrace: $stackTrace');
_resetLoadingMore();
_handleErrorGetAllOrRefreshChangesEmail(error, stackTrace);
}
@@ -474,7 +474,7 @@ class ThreadController extends BaseController with EmailActionController {
}
void _handleErrorGetAllOrRefreshChangesEmail(Object error, StackTrace stackTrace) async {
logError('ThreadController::_handleErrorGetAllOrRefreshChangesEmail():Error: $error');
logWarning('ThreadController::_handleErrorGetAllOrRefreshChangesEmail():Error: $error');
if (error is CannotCalculateChangesMethodResponseException) {
await cachingManager.clearAllEmailAndStateCache(
accountId: _accountId,
@@ -715,7 +715,7 @@ class ThreadController extends BaseController with EmailActionController {
await _refreshChangeListEmail();
}
} catch (e, stackTrace) {
logError('ThreadController::_handleWebSocketMessage:Error processing state: $e');
logWarning('ThreadController::_handleWebSocketMessage:Error processing state: $e');
onError(e, stackTrace);
} finally {
if (mailboxDashBoardController.currentEmailState != null) {
@@ -1382,7 +1382,7 @@ class ThreadController extends BaseController with EmailActionController {
mailboxContain: mailboxContain,
));
} else {
logError('ThreadController::_getEmailByIdFromLocationBar: session & accountId is NULL');
logWarning('ThreadController::_getEmailByIdFromLocationBar: session & accountId is NULL');
popAndPush(AppRoutes.unknownRoutePage);
}
}