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

cloud_firestore should throw own exceptions #638

Closed
kroikie opened this issue Oct 13, 2019 · 2 comments
Closed

cloud_firestore should throw own exceptions #638

kroikie opened this issue Oct 13, 2019 · 2 comments
Labels
impact: customer A bug with low impact (e.g. affecting only a few customers or has a workaround). (P3) plugin: cloud_firestore resolution: duplicate This issue or pull request already exists type: bug Something isn't working type: enhancement New feature or request

Comments

@kroikie
Copy link
Collaborator

kroikie commented Oct 13, 2019

As of cloud_firestore v0.8.0, all exceptions coming from the plugin are PlatformException. This makes it hard to catch specific problems.

For example, this is what I get from a regular transaction timeout exception:

PlatformException(9, Transaction failed all retries., null)
#0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:551:7)
#1      MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:279:18)
<asynchronous suspension>
#2      Firestore.runTransaction (file:///Users/filiph/dev/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.8.0/lib/src/firestore.dart:115:10)

In this particular example, I would love to have a TimeoutException instead, and catch only that.

cc @kroikie @bparrishMines

@kroikie
Copy link
Collaborator Author

kroikie commented Oct 13, 2019

@filiph

The issue at flutter/flutter#22440 has been closed and moved here. Future collaboration on this issue will be done here.

@BondarenkoStas BondarenkoStas added type: enhancement New feature or request type: bug Something isn't working labels Oct 22, 2019
@Ehesp Ehesp added plugin: cloud_firestore impact: customer A bug with low impact (e.g. affecting only a few customers or has a workaround). (P3) labels Apr 22, 2020
@Ehesp
Copy link
Member

Ehesp commented Apr 22, 2020

Duplicate #1223

@Ehesp Ehesp closed this as completed Apr 22, 2020
@Ehesp Ehesp added the resolution: duplicate This issue or pull request already exists label Apr 22, 2020
@firebase firebase locked and limited conversation to collaborators Aug 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
impact: customer A bug with low impact (e.g. affecting only a few customers or has a workaround). (P3) plugin: cloud_firestore resolution: duplicate This issue or pull request already exists type: bug Something isn't working type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants