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,12 +148,12 @@ class FileUploader {
fileName: argsUpload.fileInfo.fileName);
}
} on DioError catch (exception) {
logError('FileUploader::_handleUploadAttachmentAction():DioError: $exception');
logWarning('FileUploader::_handleUploadAttachmentAction():DioError: $exception');
throw exception.copyWith(
requestOptions: exception.requestOptions.copyWith(data: ''));
} catch (exception) {
logError('FileUploader::_handleUploadAttachmentAction():OtherException: $exception');
logWarning('FileUploader::_handleUploadAttachmentAction():OtherException: $exception');
rethrow;
}
@@ -225,7 +225,7 @@ class FileUploader {
nameFile: fileName,
charset: fileCharset);
} else {
logError('FileUploader::_parsingResponse(): DataResponseIsNullException');
logWarning('FileUploader::_parsingResponse(): DataResponseIsNullException');
throw DataResponseIsNullException();
}
}
@@ -61,7 +61,7 @@ class UploadAttachment with EquatableMixin {
_updateEvent(Right(SuccessAttachmentUploadState(uploadTaskId, attachment, fileInfo)));
} catch (error, stackTrace) {
logError('UploadAttachment::upload():ERROR: $error');
logWarning('UploadAttachment::upload():ERROR: $error');
if (error is DioError && error.type == DioErrorType.cancel) {
_updateEvent(Left(CancelAttachmentUploadState(uploadTaskId)));
} else {
@@ -76,7 +76,7 @@ class UploadFileState with EquatableMixin {
}
return mediaType?.getIcon(imagePaths, fileName: fileName) ?? imagePaths.icFileDefault;
} catch (e) {
logError('UploadFileState::getIcon: Exception: $e');
logWarning('UploadFileState::getIcon: Exception: $e');
return imagePaths.icFileDefault;
}
}