Skip to content

Commit 2de7ca6

Browse files
committed
Log exceptions when getting OAuth token
Possibly these should also be fed into `mHandler.onOAuthFailure()`, but for the moment let's at least log them.
1 parent 5f9b9bd commit 2de7ca6

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

library/src/main/java/com/firebase/ui/auth/google/GoogleOAuthTask.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import android.content.Context;
55
import android.content.Intent;
66
import android.os.AsyncTask;
7+
import android.util.Log;
78

89
import com.firebase.ui.auth.core.FirebaseLoginError;
910
import com.firebase.ui.auth.core.FirebaseResponse;
@@ -12,6 +13,8 @@
1213
import com.google.android.gms.auth.UserRecoverableAuthException;
1314

1415
class GoogleOAuthTask extends AsyncTask<String, Integer, String> {
16+
private final String TAG = "GoogleOAuthTask";
17+
1518
private Context mContext;
1619
private GoogleOAuthTaskHandler mHandler;
1720

@@ -21,11 +24,11 @@ protected String doInBackground(String... emails) {
2124
try {
2225
token = GoogleAuthUtil.getToken(mContext, emails[0], "oauth2:profile email");
2326
} catch (UserRecoverableAuthException e) {
24-
27+
Log.e(TAG, "Error getting token", e);
2528
} catch (GoogleAuthException e) {
26-
29+
Log.e(TAG, "Error getting token", e);
2730
} catch (java.io.IOException e) {
28-
31+
Log.e(TAG, "Error getting token", e);
2932
}
3033
if (!token.equals("")) return token;
3134
else return "";

0 commit comments

Comments
 (0)