mirror of
https://github.com/ente-io/ente.git
synced 2025-08-14 02:07:33 +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;
|
return uploadURL.objectKey;
|
||||||
} on DioError catch (e) {
|
} on DioError catch (e) {
|
||||||
if (e.message.startsWith(
|
if (e.message.startsWith("HttpException: Content size")) {
|
||||||
"HttpException: Content size exceeds specified contentLength.",
|
rethrow;
|
||||||
) &&
|
|
||||||
attempt == 1) {
|
|
||||||
return _putFile(
|
|
||||||
uploadURL,
|
|
||||||
file,
|
|
||||||
contentLength: (await file.readAsBytes()).length,
|
|
||||||
attempt: 2,
|
|
||||||
);
|
|
||||||
} else if (attempt < kMaximumUploadAttempts) {
|
} else if (attempt < kMaximumUploadAttempts) {
|
||||||
final newUploadURL = await _getUploadURL();
|
final newUploadURL = await _getUploadURL();
|
||||||
return _putFile(
|
return _putFile(
|
||||||
|
Reference in New Issue
Block a user