mirror of
https://github.com/ente-io/ente.git
synced 2025-08-13 01:27:17 +00:00
[mob] Rethrow exception due to content size
This commit is contained in:
committed by
Neeraj Gupta
parent
4999e9d944
commit
5820d03bb5
@@ -1297,16 +1297,8 @@ class FileUploader {
|
||||
|
||||
return uploadURL.objectKey;
|
||||
} on DioError catch (e) {
|
||||
if (e.message.startsWith(
|
||||
"HttpException: Content size exceeds specified contentLength.",
|
||||
) &&
|
||||
attempt == 1) {
|
||||
return _putFile(
|
||||
uploadURL,
|
||||
file,
|
||||
contentLength: (await file.readAsBytes()).length,
|
||||
attempt: 2,
|
||||
);
|
||||
if (e.message.startsWith("HttpException: Content size")) {
|
||||
rethrow;
|
||||
} else if (attempt < kMaximumUploadAttempts) {
|
||||
final newUploadURL = await _getUploadURL();
|
||||
return _putFile(
|
||||
|
Reference in New Issue
Block a user