Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connection error doesnt respond as onError #22

Open
worldwidee opened this issue Jan 30, 2022 · 0 comments
Open

Connection error doesnt respond as onError #22

worldwidee opened this issue Jan 30, 2022 · 0 comments

Comments

@worldwidee
Copy link

worldwidee commented Jan 30, 2022

WhatsApp Image 2022-01-30 at 23 40 20
WhatsApp Image 2022-01-30 at 23 37 48

Sometimes i get these errors while uploading data to firebase storage. However when i put UploadTask in try catch block, catch part doesnt work and also when i listen uploadtask onError part doesnt work too. For example it doesnt print "upload get err1 or err2".

try {
      uploadTask = ref.putData(File(file.filePath).readAsBytesSync());
      await uploadTask.snapshotEvents.listen((snapshot) {
        uploadingValue =
            ((snapshot.bytesTransferred / snapshot.totalBytes) * 100).toInt() /
                100;
        print('Progress: %${uploadingValue * 100}');
      }, onDone: () async {
        print("UPLOAD DONE!!!");
        print("uploadFail:$cloudFail");
        if (!cloudFail) {
          setState(() {
            uploaded = true;
          });
          await triggerStorageFiles();
          saveDb();
        }
      }, onError: (e) {
        print("upload get err1:$e");
        cancellUpload();
        cloudFail = true;
        saveDb();
      });
    } catch (e) {
      print("upload get err2:$e");
    }

By the way its happening while connected wifi. I dont get this err when i connected with cable.

Edit:
same error
Unhandled Exception: SocketException: OS Error: Operation timed out, errno = 60, address = firebasestorage.googleapis.com, port = 51294
its happening while uploading big file or 20-30 small files. So i think its becoming timed out with wifi connection. How can i fix it :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant