use of com.facebook.internal.FacebookRequestErrorClassification in project facebook-android-sdk by facebook.
the class FacebookRequestError method getErrorClassification.
static synchronized FacebookRequestErrorClassification getErrorClassification() {
FacebookRequestErrorClassification errorClassification;
FetchedAppSettings appSettings = FetchedAppSettingsManager.getAppSettingsWithoutQuery(FacebookSdk.getApplicationId());
if (appSettings == null) {
return FacebookRequestErrorClassification.getDefaultErrorClassification();
}
return appSettings.getErrorClassification();
}
use of com.facebook.internal.FacebookRequestErrorClassification in project facebook-android-sdk by facebook.
the class ErrorClassificationTest method testDefaultErrorClassification.
@Test
public void testDefaultErrorClassification() {
FacebookRequestErrorClassification errorClassification = FacebookRequestErrorClassification.getDefaultErrorClassification();
// Test transient takes precedence
assertEquals(FacebookRequestError.Category.TRANSIENT, errorClassification.classify(FacebookRequestErrorClassification.EC_INVALID_TOKEN, 0, true));
assertEquals(FacebookRequestError.Category.LOGIN_RECOVERABLE, errorClassification.classify(FacebookRequestErrorClassification.EC_INVALID_SESSION, 0, false));
assertEquals(FacebookRequestError.Category.LOGIN_RECOVERABLE, errorClassification.classify(FacebookRequestErrorClassification.EC_INVALID_TOKEN, 0, false));
assertEquals(FacebookRequestError.Category.TRANSIENT, errorClassification.classify(FacebookRequestErrorClassification.EC_SERVICE_UNAVAILABLE, 0, false));
assertEquals(FacebookRequestError.Category.TRANSIENT, errorClassification.classify(FacebookRequestErrorClassification.EC_APP_TOO_MANY_CALLS, 0, false));
assertEquals(FacebookRequestError.Category.TRANSIENT, errorClassification.classify(FacebookRequestErrorClassification.EC_RATE, 0, false));
assertEquals(FacebookRequestError.Category.TRANSIENT, errorClassification.classify(FacebookRequestErrorClassification.EC_USER_TOO_MANY_CALLS, 0, false));
assertEquals(FacebookRequestError.Category.TRANSIENT, errorClassification.classify(FacebookRequestErrorClassification.EC_TOO_MANY_USER_ACTION_CALLS, 0, false));
}
Aggregations