Skip to content

Commit 37dd2b1

Browse files
authored
Adding a descriptive auth error message. (#1774)
* Add a descriptive error message. * Addressing rayo's comments.
1 parent 334aa44 commit 37dd2b1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

firebase-installations/src/main/java/com/google/firebase/installations/FirebaseInstallations.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,11 @@ public Thread newThread(Runnable r) {
109109
+ "with Firebase server APIs: It identifies your application with Firebase."
110110
+ "Please refer to https://firebase.google.com/support/privacy/init-options.";
111111

112+
private static final String AUTH_ERROR_MSG =
113+
"Installation ID could not be validated with the Firebase servers (maybe it was deleted). "
114+
+ "Firebase Installations will need to create a new Installation ID and auth token. "
115+
+ "Please retry your last request.";
116+
112117
/** package private constructor. */
113118
FirebaseInstallations(
114119
FirebaseApp firebaseApp,
@@ -378,7 +383,7 @@ private void doNetworkCallIfNecessary(boolean forceRefresh) {
378383
} else if (prefs.isNotGenerated()) {
379384
// If there is no fid it means the call failed with an auth error. Simulate an
380385
// IOException so that the caller knows to try again.
381-
triggerOnException(prefs, new IOException("cleared fid due to auth error"));
386+
triggerOnException(prefs, new IOException(AUTH_ERROR_MSG));
382387
} else {
383388
triggerOnStateReached(prefs);
384389
}

0 commit comments

Comments
 (0)