Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

[cloud_firestore,firebase_database,firebase_storage] handling error nil on getFlutterError#1274

Merged
cyanglaz merged 2 commits intoflutter:masterfrom
ffeu:fixgetfluttererror
Feb 25, 2019
Merged

[cloud_firestore,firebase_database,firebase_storage] handling error nil on getFlutterError#1274
cyanglaz merged 2 commits intoflutter:masterfrom
ffeu:fixgetfluttererror

Conversation

@ffeu
Copy link
Contributor

@ffeu ffeu commented Feb 24, 2019

When getFlutterError was introduced, some plugins started to throw exceptions for successful operations. I originally faced that with firebase_database, but I can see the same happened to cloud_firestore.

As you can see in the code, either the caller would have to be changed to check for error == nil before calling it, or we can do it inside getFlutterError and keep the plugin original code.

I checked the other plugins, and apparently they don't need the same change as they already do the check or use the getFlutterError differently.

Some of the formatting of the error code was slightly changed and I restored it to what it was, please let me know if that's ok or if that change was intentional.

intends to
fix flutter/flutter#28344
fix flutter/flutter#28065
fix flutter/flutter#28103

cc @collinjackson @kroikie @cyanglaz

Copy link
Contributor

@cyanglaz cyanglaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much for providing the fix! I have added some comments.

@oliverbytes
Copy link

Amazing! Thanks a lot for the fix.

romaluca pushed a commit to romaluca/plugins that referenced this pull request Mar 6, 2019
… nil on getFlutterError (flutter#1274)

When `getFlutterError` was introduced(flutter#1226), some plugins started to throw exceptions for successful operations. This fixed the issue. Related issues include flutter/flutter#28344; flutter/flutter#28065; flutter/flutter#28103
It also fixed an unintentional typo introduced in the same PR.(flutter#1226)
romaluca pushed a commit to romaluca/plugins that referenced this pull request Mar 6, 2019
collinjackson pushed a commit to collinjackson/flutterfire-old2 that referenced this pull request Jun 24, 2019
collinjackson pushed a commit to firebase/flutterfire that referenced this pull request Aug 14, 2019
julianscheel pushed a commit to jusst-engineering/plugins that referenced this pull request Mar 11, 2020
… nil on getFlutterError (flutter#1274)

When `getFlutterError` was introduced(flutter#1226), some plugins started to throw exceptions for successful operations. This fixed the issue. Related issues include flutter/flutter#28344; flutter/flutter#28065; flutter/flutter#28103
It also fixed an unintentional typo introduced in the same PR.(flutter#1226)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

4 participants