Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
pass the exception to dart so user can have clearer knowledge what we…
…nt wrong
  • Loading branch information
Chris Yang committed Feb 7, 2019
commit 5335ccefd0c44d6f6b35b43087a9c018c0bd1aa3
7 changes: 6 additions & 1 deletion packages/google_sign_in/ios/Classes/GoogleSignInPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,12 @@ - (void)handleMethodCall:(FlutterMethodCall *)call result:(FlutterResult)result
result(@([[GIDSignIn sharedInstance] hasAuthInKeychain]));
} else if ([call.method isEqualToString:@"signIn"]) {
if ([self setAccountRequest:result]) {
[[GIDSignIn sharedInstance] signIn];
@try {
[[GIDSignIn sharedInstance] signIn];
} @catch (NSException *e) {
result([FlutterError errorWithCode:@"google_sign_in" message:e.reason details:e.name]);
[e raise];
Copy link
Contributor Author

@cyanglaz cyanglaz Feb 7, 2019

Choose a reason for hiding this comment

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

Still Debating myself if we should fail more graciously that was requested by the customer in flutter/flutter#12734 or we should still crashing it to just have better error message to force user to fix it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Missing configuration is fatal. An app like this should never be released and there's no gracious failure for it. Raising FlutterError is the right way to go for this.

}
}
} else if ([call.method isEqualToString:@"getTokens"]) {
GIDGoogleUser *currentUser = [GIDSignIn sharedInstance].currentUser;
Expand Down