Browse Source

Throw an exception when file upload times out

vishnukvmd 3 năm trước cách đây
mục cha
commit
02b5197cdd
1 tập tin đã thay đổi với 4 bổ sung3 xóa
  1. 4 3
      lib/utils/file_uploader.dart

+ 4 - 3
lib/utils/file_uploader.dart

@@ -329,9 +329,10 @@ class FileUploader {
       final fileUploadURL = await _getUploadURL();
       final fileUploadURL = await _getUploadURL();
       String fileObjectKey = await _putFile(fileUploadURL, encryptedFile)
       String fileObjectKey = await _putFile(fileUploadURL, encryptedFile)
           .timeout(kFileUploadTimeout, onTimeout: () async {
           .timeout(kFileUploadTimeout, onTimeout: () async {
-        _logger.severe("Upload timed out for file of size " +
-            (await encryptedFile.length()).toString());
-        return;
+        final message = "Upload timed out for file of size " +
+            (await encryptedFile.length()).toString();
+        _logger.severe(message);
+        throw TimeoutException(message);
       });
       });
 
 
       final metadata =
       final metadata =