Skip to content

Adding a descriptive auth error message. #1774

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

Merged
merged 2 commits into from
Jul 15, 2020
Merged
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,11 @@ public Thread newThread(Runnable r) {
+ "with Firebase server APIs: It identifies your application with Firebase."
+ "Please refer to https://firebase.google.com/support/privacy/init-options.";

private static final String AUTH_ERROR_MSG =
"Installation ID could not be validated with the Firebase servers (maybe it was deleted). "
+ "Firebase Installations will need to create a new Installation ID and auth token. "
+ "Please retry your last request.";

/** package private constructor. */
FirebaseInstallations(
FirebaseApp firebaseApp,
Expand Down Expand Up @@ -378,7 +383,7 @@ private void doNetworkCallIfNecessary(boolean forceRefresh) {
} else if (prefs.isNotGenerated()) {
// If there is no fid it means the call failed with an auth error. Simulate an
// IOException so that the caller knows to try again.
triggerOnException(prefs, new IOException("cleared fid due to auth error"));
triggerOnException(prefs, new IOException(AUTH_ERROR_MSG));
} else {
triggerOnStateReached(prefs);
}
Expand Down