fun classify()

in facebook-core/src/main/java/com/facebook/internal/FacebookRequestErrorClassification.kt [51:78]


  fun classify(
      errorCode: Int,
      errorSubCode: Int,
      isTransient: Boolean
  ): FacebookRequestError.Category {
    if (isTransient) {
      return FacebookRequestError.Category.TRANSIENT
    }
    if (otherErrors != null && otherErrors.containsKey(errorCode)) {
      val subCodes = otherErrors[errorCode]
      if (subCodes == null || subCodes.contains(errorSubCode)) {
        return FacebookRequestError.Category.OTHER
      }
    }
    if (loginRecoverableErrors != null && loginRecoverableErrors.containsKey(errorCode)) {
      val subCodes = loginRecoverableErrors[errorCode]
      if (subCodes == null || subCodes.contains(errorSubCode)) {
        return FacebookRequestError.Category.LOGIN_RECOVERABLE
      }
    }
    if (transientErrors != null && transientErrors.containsKey(errorCode)) {
      val subCodes = transientErrors[errorCode]
      if (subCodes == null || subCodes.contains(errorSubCode)) {
        return FacebookRequestError.Category.TRANSIENT
      }
    }
    return FacebookRequestError.Category.OTHER
  }