Bug 1403787 - Change try/catch to catch the correct exception r=nalexander
We're aiming to catch FileNotFound exceptions here, but underneath they're re-thrown as IllegalStateException.
MozReview-Commit-ID: HaCpbqq93q0
--- a/mobile/android/services/src/main/java/org/mozilla/gecko/fxa/devices/FxAccountDeviceRegistrator.java
+++ b/mobile/android/services/src/main/java/org/mozilla/gecko/fxa/devices/FxAccountDeviceRegistrator.java
@@ -290,17 +290,17 @@ public class FxAccountDeviceRegistrator
fxAccount.setDeviceRegistrationTimestamp(0L);
}
private static String getClientName(final AndroidFxAccount fxAccount, final Context context) {
try {
final SharedPreferencesClientsDataDelegate clientsDataDelegate =
new SharedPreferencesClientsDataDelegate(fxAccount.getSyncPrefs(), context);
return clientsDataDelegate.getClientName();
- } catch (IOException | GeneralSecurityException e) {
+ } catch (Exception e) {
Log.e(LOG_TAG, "Unable to get client name.", e);
// It's possible we're racing against account pickler.
// In either case, it should be always safe to perform registration using our default name.
return FxAccountUtils.defaultClientName(context);
}
}
private static void handleTokenError(final FxAccountClientRemoteException error,