Explorar el Código

Throw an exception when file upload times out

vishnukvmd hace 3 años
padre
commit
02b5197cdd
Se han modificado 1 ficheros con 4 adiciones y 3 borrados
  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();
       String fileObjectKey = await _putFile(fileUploadURL, encryptedFile)
           .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 =