- Sending n/w exception logMsg in clickstream of screenName_error (#4885)
- updated n/w error codes
This commit is contained in:
committed by
GitHub Enterprise
parent
367d334fac
commit
dec919347f
@@ -1,6 +1,7 @@
|
||||
/*
|
||||
* *
|
||||
* * Copyright (c) 2019 . All rights reserved @Navi
|
||||
*
|
||||
* * Copyright © 2019-2023 by Navi Technologies Limited
|
||||
* * All rights reserved. Strictly confidential
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -16,14 +17,11 @@ object ApiConstants {
|
||||
const val API_SUCCESS_CODE_201 = 201
|
||||
const val API_SUCCESS_CODE_204 = 204
|
||||
const val API_ERROR_NO_USER_FOUND = 401
|
||||
const val API_CODE_ERROR = -100
|
||||
const val API_CODE_SOCKET_TIMEOUT = -101
|
||||
const val API_TOO_MANY_REQUESTS = 429
|
||||
const val API_EXPIRED_OTP = 410
|
||||
const val API_WRONG_OTP = 401
|
||||
const val API_ERROR_SYSTEM_UNDER_MAINTENANCE_CODE = 503
|
||||
const val API_WRONG_PROMO_CODE = 400
|
||||
const val AADHAAR_USER_CANCELLED = 1003
|
||||
|
||||
const val E_OFFER_EXPIRED = "E_OFFER_EXPIRED"
|
||||
const val E_PAN_NAME_MISMATCH = "E_PAN_RETRY_01"
|
||||
@@ -35,4 +33,4 @@ object ApiConstants {
|
||||
const val MAX_ACTION_RETRY_LIMIT_REACHED = "MAX_ACTION_RETRY_LIMIT_REACHED"
|
||||
const val LEGAL_URL = BuildConfig.BASE_URL.plus("v1/mobile/document?type=")
|
||||
const val MIME_TYPE_TEXT_PLAIN = "text/plain"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,9 @@ package com.naviapp.network.retrofit
|
||||
import com.google.gson.Gson
|
||||
import com.google.gson.reflect.TypeToken
|
||||
import com.navi.base.utils.BaseUtils
|
||||
import com.navi.common.constants.NO_INTERNET
|
||||
import com.navi.common.network.ApiConstants.API_CODE_ERROR
|
||||
import com.navi.common.network.ApiConstants.API_CODE_SOCKET_TIMEOUT
|
||||
import com.navi.common.network.ApiConstants.NO_INTERNET
|
||||
import com.navi.common.network.models.ErrorMessage
|
||||
import com.navi.common.network.models.GenericResponse
|
||||
import com.navi.common.network.models.RepoResult
|
||||
@@ -19,8 +21,6 @@ import com.naviapp.app.NaviApplication
|
||||
import com.naviapp.errors.activities.ErrorActivity.Companion.LOAN_OFFER_EXPIRED
|
||||
import com.naviapp.errors.activities.ErrorActivity.Companion.SYSTEM_UNDER_MAINTENANCE
|
||||
import com.naviapp.models.RedirectPageStatus
|
||||
import com.naviapp.network.ApiConstants.API_CODE_ERROR
|
||||
import com.naviapp.network.ApiConstants.API_CODE_SOCKET_TIMEOUT
|
||||
import com.naviapp.network.ApiConstants.API_ERROR_NO_USER_FOUND
|
||||
import com.naviapp.network.ApiConstants.API_ERROR_SYSTEM_UNDER_MAINTENANCE_CODE
|
||||
import com.naviapp.network.ApiConstants.API_SUCCESS_CODE
|
||||
@@ -52,8 +52,8 @@ abstract class ResponseCallback {
|
||||
}
|
||||
if (
|
||||
it.statusCode == API_SUCCESS_CODE ||
|
||||
it.statusCode == API_SUCCESS_CODE_201 ||
|
||||
it.statusCode == API_SUCCESS_CODE_204
|
||||
it.statusCode == API_SUCCESS_CODE_201 ||
|
||||
it.statusCode == API_SUCCESS_CODE_204
|
||||
) {
|
||||
return RepoResult(it.data, null, it.errors, it.warning, it.statusCode)
|
||||
} else if (it.statusCode == API_ERROR_NO_USER_FOUND) {
|
||||
@@ -62,7 +62,12 @@ abstract class ResponseCallback {
|
||||
}
|
||||
return RepoResult(
|
||||
null,
|
||||
ErrorMessage(it.statusCode, it.message, it.message, apiUrl = response.raw().request.url.toString()),
|
||||
ErrorMessage(
|
||||
it.statusCode,
|
||||
it.message,
|
||||
it.message,
|
||||
apiUrl = response.raw().request.url.toString()
|
||||
),
|
||||
it.errors,
|
||||
it.warning,
|
||||
it.statusCode
|
||||
@@ -71,7 +76,6 @@ abstract class ResponseCallback {
|
||||
?: run {
|
||||
if (response.code() == API_ERROR_NO_USER_FOUND && BaseUtils.isUserLoggedIn()) {
|
||||
// logged out or session expired here
|
||||
|
||||
deleteCacheAndOpenLoginPage()
|
||||
return RepoResult()
|
||||
} else if (response.code() == API_SUCCESS_CODE_204) {
|
||||
@@ -90,7 +94,12 @@ abstract class ResponseCallback {
|
||||
}
|
||||
return RepoResult(
|
||||
null,
|
||||
ErrorMessage(response.code(), response.message(), response.message(),apiUrl = response.raw().request.url.toString()),
|
||||
ErrorMessage(
|
||||
response.code(),
|
||||
response.message(),
|
||||
response.message(),
|
||||
apiUrl = response.raw().request.url.toString()
|
||||
),
|
||||
errorResponse?.errors,
|
||||
null,
|
||||
errorResponse?.statusCode
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* * Copyright © 2019-2022 by Navi Technologies Limited
|
||||
* * Copyright © 2019-2023 by Navi Technologies Limited
|
||||
* * All rights reserved. Strictly confidential
|
||||
*
|
||||
*/
|
||||
@@ -12,19 +12,17 @@ import androidx.lifecycle.MutableLiveData
|
||||
import androidx.lifecycle.viewModelScope
|
||||
import com.navi.amc.utils.orZero
|
||||
import com.navi.base.sharedpref.PreferenceManager
|
||||
import com.navi.common.constants.NO_INTERNET
|
||||
import com.navi.common.model.UploadDataAsyncResponse
|
||||
import com.navi.common.network.NetworkErrorCode
|
||||
import com.navi.common.network.ApiConstants.API_CODE_SOCKET_TIMEOUT
|
||||
import com.navi.common.network.ApiConstants.NO_INTERNET
|
||||
import com.navi.common.network.models.GenericErrorResponse
|
||||
import com.navi.common.viewmodel.BaseVM
|
||||
import com.naviapp.models.RedirectPageStatus
|
||||
import com.naviapp.models.request.BankDetail
|
||||
import com.naviapp.models.response.*
|
||||
import com.naviapp.network.ApiConstants
|
||||
import com.naviapp.network.ApiErrorTagType
|
||||
import com.naviapp.personalloan.getloan.bankdetails.models.BankBranch
|
||||
import com.naviapp.personalloan.getloan.bankdetails.repositories.BankDetailsRepository
|
||||
import com.naviapp.utils.Constants
|
||||
import com.naviapp.utils.LOAN_APPLICATION_ID
|
||||
import com.naviapp.utils.isNetworkAvailable
|
||||
import kotlinx.coroutines.launch
|
||||
@@ -91,8 +89,7 @@ class BankDetailsVM(private val repository: BankDetailsRepository = BankDetailsR
|
||||
} else {
|
||||
if (isNetworkAvailable().not()) {
|
||||
_noInternetConnection.value = NO_INTERNET
|
||||
} else if ((response.error?.statusCode.orZero() == ApiConstants.API_CODE_SOCKET_TIMEOUT)
|
||||
|| (response.error?.statusCode.orZero() == NetworkErrorCode.NETWORK_CRASH_ERROR_CODE)) {
|
||||
} else if ((response.error?.statusCode.orZero() == API_CODE_SOCKET_TIMEOUT)) {
|
||||
_noInternetConnection.value = response.error?.statusCode
|
||||
} else {
|
||||
_bankDetailAdd.value = null
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
/*
|
||||
*
|
||||
* * Copyright © 2022 by Navi Technologies Limited
|
||||
* * Copyright © 2022-2023 by Navi Technologies Limited
|
||||
* * All rights reserved. Strictly confidential
|
||||
*
|
||||
*/
|
||||
|
||||
package com.naviapp.personalloanrevamp.getloanRevamp.activities
|
||||
|
||||
import android.animation.Animator
|
||||
import android.app.Activity
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
@@ -25,9 +24,9 @@ import com.navi.base.model.CtaData
|
||||
import com.navi.base.sharedpref.PreferenceManager
|
||||
import com.navi.common.firebasedb.*
|
||||
import com.navi.common.model.ModuleNameV2
|
||||
import com.navi.common.model.StyledTextWithIconCode
|
||||
import com.navi.common.model.UploadDataAsyncResponse
|
||||
import com.navi.common.network.NetworkErrorCode
|
||||
import com.navi.common.network.ApiConstants.API_CODE_SOCKET_TIMEOUT
|
||||
import com.navi.common.network.ApiConstants.NO_INTERNET
|
||||
import com.navi.common.ui.activity.BaseActivity
|
||||
import com.navi.common.utils.*
|
||||
import com.naviapp.R
|
||||
@@ -272,8 +271,7 @@ class BankAccountVerificationLoaderV2Activity : BaseActivity() {
|
||||
viewModel.noInternetConnection.observeNonNull(this) {
|
||||
|
||||
when (it) {
|
||||
|
||||
com.navi.common.constants.NO_INTERNET -> {
|
||||
NO_INTERNET -> {
|
||||
setUpRetryBankAccountVerificationScreen(
|
||||
title = resources.getString(com.navi.common.R.string.no_internet_connection),
|
||||
subtitle = resources.getString(com.navi.common.R.string.check_internet_connectivity),
|
||||
@@ -281,7 +279,7 @@ class BankAccountVerificationLoaderV2Activity : BaseActivity() {
|
||||
)
|
||||
}
|
||||
|
||||
ApiConstants.API_CODE_SOCKET_TIMEOUT, NetworkErrorCode.NETWORK_CRASH_ERROR_CODE -> {
|
||||
API_CODE_SOCKET_TIMEOUT -> {
|
||||
setUpRetryBankAccountVerificationScreen(
|
||||
title = getString(R.string.bank_verification_timeout_title),
|
||||
subtitle = getString(R.string.bank_verification_timeout_description)
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
/*
|
||||
*
|
||||
* * Copyright © 2022 by Navi Technologies Private Limited
|
||||
* * Copyright © 2022-2023 by Navi Technologies Limited
|
||||
* * All rights reserved. Strictly confidential
|
||||
*
|
||||
*/
|
||||
|
||||
package com.navi.chat.network.interceptors
|
||||
|
||||
import android.content.Context
|
||||
@@ -14,8 +15,9 @@ import com.navi.chat.di.scopes.NaviChatScope
|
||||
import com.navi.common.constants.*
|
||||
import com.navi.common.model.ModuleName
|
||||
import com.navi.common.model.NetworkInfo
|
||||
import com.navi.common.network.NetworkErrorCode
|
||||
import com.navi.base.utils.BaseUtils
|
||||
import com.navi.common.network.ApiConstants
|
||||
import com.navi.common.network.handleException
|
||||
import okhttp3.Interceptor
|
||||
import okhttp3.MediaType.Companion.toMediaTypeOrNull
|
||||
import okhttp3.Protocol
|
||||
@@ -58,8 +60,10 @@ class HeaderInterceptor(
|
||||
mapOf(Pair(MESSAGE_TEXT, e.message.orEmpty()))
|
||||
)
|
||||
// A mocked response in case of n/w exception
|
||||
val errorMessage = handleException(e)
|
||||
val errorStatusCode: Int = errorMessage.statusCode ?: ApiConstants.API_CODE_ERROR
|
||||
Response.Builder().request(request).protocol(Protocol.HTTP_2)
|
||||
.code(NetworkErrorCode.NETWORK_CRASH_ERROR_CODE)
|
||||
.code(errorStatusCode)
|
||||
.message(e.message.orEmpty()).body(
|
||||
ResponseBody.create(
|
||||
APPLICATION_JSON.toMediaTypeOrNull(),
|
||||
@@ -70,4 +74,4 @@ class HeaderInterceptor(
|
||||
.build()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
/*
|
||||
*
|
||||
* * Copyright © 2023 by Navi Technologies Limited
|
||||
* * All rights reserved. Strictly confidential
|
||||
*
|
||||
*/
|
||||
|
||||
package com.navi.common.constants
|
||||
|
||||
const val SYSTEM_UNDER_MAINTENANCE = "SYSTEM_UNDER_MAINTENANCE"
|
||||
const val CONTENT_TYPE = "Content-Type"
|
||||
const val APPLICATION_JSON = "application/json"
|
||||
const val APP_VERSION = "appVersion"
|
||||
@@ -17,15 +23,8 @@ const val NETWORK_CRASH = "network_crash"
|
||||
const val MESSAGE_TEXT = "message"
|
||||
const val NETWORK_CONNECTION_ALIVE_TIME = 5L
|
||||
const val NETWORK_CONNECTION_MAX_IDLE_TIME = 0
|
||||
const val SOURCE_TEXT = "source"
|
||||
const val APK_TEXT = "APK"
|
||||
|
||||
const val API_SUCCESS_CODE = 200
|
||||
const val API_SUCCESS_CODE_201 = 201
|
||||
const val API_CODE_ERROR = -100
|
||||
const val API_CODE_SOCKET_TIMEOUT = -101
|
||||
const val API_ERROR_SYSTEM_UNDER_MAINTENANCE_CODE = 503
|
||||
const val NO_INTERNET = -200
|
||||
|
||||
|
||||
const val PROPERTY_EXCEPTION = "exception"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* * Copyright © 2022 by Navi Technologies Limited
|
||||
* * Copyright © 2022-2023 by Navi Technologies Limited
|
||||
* * All rights reserved. Strictly confidential
|
||||
*
|
||||
*/
|
||||
@@ -9,21 +9,26 @@ package com.navi.common.network
|
||||
|
||||
import androidx.annotation.Keep
|
||||
|
||||
/**
|
||||
* Don't keep negative codes
|
||||
*/
|
||||
@Keep
|
||||
object ApiConstants {
|
||||
const val API_CONNECT_TIMEOUT_VALUE = 20L
|
||||
const val API_SUCCESS_CODE = 200
|
||||
const val API_SUCCESS_CODE_204 = 204
|
||||
const val API_ERROR_NO_USER_FOUND = 401
|
||||
const val API_CODE_ERROR = -100
|
||||
const val NO_INTERNET = -200
|
||||
const val API_CODE_SOCKET_TIMEOUT = -101
|
||||
const val API_CODE_ERROR = 20
|
||||
const val NO_INTERNET = 23
|
||||
const val API_CODE_SOCKET_TIMEOUT = 24
|
||||
const val API_INTERNAL_SERVER_ERROR = 500
|
||||
const val API_BAD_GATEWAY = 502
|
||||
const val API_BAD_REQUEST = 400
|
||||
const val API_NOT_FOUND = 404
|
||||
const val API_FORBIDDEN = 403
|
||||
const val API_WRONG_OTP = 401
|
||||
const val API_WRONG_ERROR_RESPONSE = 503
|
||||
const val API_WRONG_ERROR_RESPONSE = 25
|
||||
const val MIME_TYPE_TEXT_PLAIN = "text/plain"
|
||||
const val API_CODE_UNKNOWN_HOST = 21
|
||||
const val API_CODE_CONNECT_EXCEPTION = 22
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* * Copyright © 2020-2022 by Navi Technologies Limited
|
||||
* * Copyright © 2020-2023 by Navi Technologies Limited
|
||||
* * All rights reserved. Strictly confidential
|
||||
*
|
||||
*/
|
||||
@@ -13,12 +13,11 @@ import com.navi.analytics.utils.NaviAnalyticsHelper
|
||||
import com.navi.analytics.utils.NaviTrackEvent
|
||||
import com.navi.base.utils.BaseUtils
|
||||
import com.navi.common.model.NetworkInfo
|
||||
import com.navi.common.network.NetworkErrorCode.NETWORK_CRASH_ERROR_CODE
|
||||
import java.io.IOException
|
||||
import java.util.concurrent.TimeUnit
|
||||
import okhttp3.*
|
||||
import okhttp3.MediaType.Companion.toMediaTypeOrNull
|
||||
import timber.log.Timber
|
||||
import java.io.IOException
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
||||
abstract class BaseHttpClient(private val networkInfo: NetworkInfo, private val context: Context) {
|
||||
val baseHttpClientBuilder: OkHttpClient.Builder
|
||||
@@ -60,15 +59,17 @@ abstract class BaseHttpClient(private val networkInfo: NetworkInfo, private val
|
||||
try {
|
||||
chain.proceed(request)
|
||||
} catch (e: IOException) {
|
||||
val errorMessage = handleException(e)
|
||||
NaviTrackEvent.trackEventOnClickStream(
|
||||
"network_crash",
|
||||
mapOf(Pair("message", e.message.orEmpty()))
|
||||
)
|
||||
// A mocked response in case of n/w exception
|
||||
val errorStatusCode: Int = errorMessage.statusCode ?: ApiConstants.API_CODE_ERROR
|
||||
Response.Builder()
|
||||
.request(request)
|
||||
.protocol(Protocol.HTTP_2)
|
||||
.code(NETWORK_CRASH_ERROR_CODE)
|
||||
.code(errorStatusCode)
|
||||
.message(e.message.orEmpty())
|
||||
.body(ResponseBody.create("application/json".toMediaTypeOrNull(), "{}"))
|
||||
.addHeader("content-type", "application/json")
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
/*
|
||||
*
|
||||
* * Copyright © 2019 by Navi Technologies Private Limited
|
||||
* * All rights reserved. Strictly confidential
|
||||
*
|
||||
*/
|
||||
|
||||
package com.navi.common.network
|
||||
|
||||
object NetworkErrorCode {
|
||||
const val NETWORK_CRASH_ERROR_CODE = 490
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
*
|
||||
* * Copyright © 2023 by Navi Technologies Limited
|
||||
* * All rights reserved. Strictly confidential
|
||||
*
|
||||
*/
|
||||
|
||||
package com.navi.common.network
|
||||
|
||||
import com.google.gson.JsonParseException
|
||||
import com.navi.analytics.utils.NaviAnalyticsHelper
|
||||
import com.navi.analytics.utils.NaviTrackEvent
|
||||
import com.navi.base.utils.BaseUtils
|
||||
import com.navi.common.CommonLibManager
|
||||
import com.navi.common.network.models.ErrorMessage
|
||||
import com.navi.common.utils.CommonNaviAnalytics
|
||||
import timber.log.Timber
|
||||
import java.net.ConnectException
|
||||
import java.net.SocketTimeoutException
|
||||
import java.net.UnknownHostException
|
||||
|
||||
fun handleException(e: Throwable, tag: String? = null): ErrorMessage {
|
||||
Timber.d(e, "Failure during processing")
|
||||
NaviAnalyticsHelper.recordException(e)
|
||||
val errorMessage = ErrorMessage()
|
||||
if (!BaseUtils.isNetworkAvailable(CommonLibManager.application)) {
|
||||
errorMessage.statusCode = ApiConstants.NO_INTERNET
|
||||
errorMessage.errorTag = tag ?: ApiErrorTagType.NO_INTERNET_ERROR.value
|
||||
} else if (e is ConnectException) {
|
||||
errorMessage.statusCode = ApiConstants.API_CODE_CONNECT_EXCEPTION
|
||||
errorMessage.errorTag = tag ?: ApiErrorTagType.NO_INTERNET_ERROR.value
|
||||
} else if (e is UnknownHostException) {
|
||||
errorMessage.statusCode = ApiConstants.API_CODE_UNKNOWN_HOST
|
||||
} else if (e is SocketTimeoutException) {
|
||||
errorMessage.statusCode = ApiConstants.API_CODE_SOCKET_TIMEOUT
|
||||
NaviTrackEvent.trackEvent(CommonNaviAnalytics.API_CONNECTION_TIMEOUT)
|
||||
} else if (e is JsonParseException) {
|
||||
errorMessage.statusCode = ApiConstants.API_WRONG_ERROR_RESPONSE
|
||||
} else {
|
||||
errorMessage.statusCode = ApiConstants.API_CODE_ERROR
|
||||
}
|
||||
errorMessage.message = e.message
|
||||
return errorMessage
|
||||
}
|
||||
@@ -24,7 +24,8 @@ data class GenericErrorResponse(
|
||||
@SerializedName("additionalDescription") val additionalDescription: List<String>? = null,
|
||||
@SerializedName("isNewJourneyCustomer") val isNewJourneyCustomer: Boolean? = null,
|
||||
@SerializedName("statusCode") val statusCode: Int? = null,
|
||||
val apiUrl: String? = null
|
||||
val apiUrl: String? = null,
|
||||
val logMessage: String? = null
|
||||
) : Parcelable
|
||||
|
||||
@Parcelize
|
||||
|
||||
@@ -40,7 +40,8 @@ class CommonNaviAnalytics private constructor() {
|
||||
mapOf(
|
||||
Pair("error_data", error.toString()),
|
||||
Pair("message", errorMessage.toString()),
|
||||
Pair("apiUrl", error?.apiUrl.toString())
|
||||
Pair("apiUrl", error?.apiUrl.toString()),
|
||||
Pair("logMessage", error?.logMessage.toString()),
|
||||
)
|
||||
NaviTrackEvent.trackEvent(eventName, map)
|
||||
}
|
||||
|
||||
@@ -24,7 +24,8 @@ fun getErrorData(
|
||||
title: String? = null,
|
||||
context: Context,
|
||||
statusCode: Int? = null,
|
||||
apiUrl: String? = null
|
||||
apiUrl: String? = null,
|
||||
logMessage: String? = null
|
||||
): GenericErrorResponse {
|
||||
return GenericErrorResponse(
|
||||
listOf(Action(title ?: context.getString(R.string.retry))),
|
||||
@@ -34,11 +35,17 @@ fun getErrorData(
|
||||
null,
|
||||
GENERAL_ERROR,
|
||||
statusCode = statusCode,
|
||||
apiUrl = apiUrl
|
||||
apiUrl = apiUrl,
|
||||
logMessage = logMessage
|
||||
)
|
||||
}
|
||||
|
||||
fun getApiFailedData(context: Context, statusCode: Int? = null, apiUrl: String? = null): GenericErrorResponse {
|
||||
fun getApiFailedData(
|
||||
context: Context,
|
||||
statusCode: Int? = null,
|
||||
apiUrl: String? = null,
|
||||
logMessage: String? = null
|
||||
): GenericErrorResponse {
|
||||
return GenericErrorResponse(
|
||||
listOf(Action(context.getString(R.string.retry))),
|
||||
AssetDetails(GENERIC_ERROR),
|
||||
@@ -47,14 +54,16 @@ fun getApiFailedData(context: Context, statusCode: Int? = null, apiUrl: String?
|
||||
null,
|
||||
GENERAL_ERROR,
|
||||
statusCode = statusCode,
|
||||
apiUrl = apiUrl
|
||||
apiUrl = apiUrl,
|
||||
logMessage = logMessage
|
||||
)
|
||||
}
|
||||
|
||||
fun getNoInternetData(
|
||||
context: Context,
|
||||
statusCode: Int? = null,
|
||||
apiUrl: String? = null
|
||||
apiUrl: String? = null,
|
||||
logMessage: String? = null
|
||||
): GenericErrorResponse {
|
||||
return GenericErrorResponse(
|
||||
listOf(Action(context.getString(R.string.retry))),
|
||||
@@ -64,11 +73,17 @@ fun getNoInternetData(
|
||||
null,
|
||||
NO_INTERNET,
|
||||
statusCode = statusCode,
|
||||
apiUrl = apiUrl
|
||||
apiUrl = apiUrl,
|
||||
logMessage = logMessage
|
||||
)
|
||||
}
|
||||
|
||||
fun getSocketTimeOutData(context: Context, statusCode: Int? = null, apiUrl: String? = null): GenericErrorResponse {
|
||||
fun getSocketTimeOutData(
|
||||
context: Context,
|
||||
statusCode: Int? = null,
|
||||
apiUrl: String? = null,
|
||||
logMessage: String? = null
|
||||
): GenericErrorResponse {
|
||||
return GenericErrorResponse(
|
||||
listOf(Action(context.getString(R.string.retry))),
|
||||
AssetDetails(WIFI_ERROR_ICON),
|
||||
@@ -77,7 +92,8 @@ fun getSocketTimeOutData(context: Context, statusCode: Int? = null, apiUrl: Stri
|
||||
null,
|
||||
SOCKET_TIMEOUT,
|
||||
statusCode = statusCode,
|
||||
apiUrl = apiUrl
|
||||
apiUrl = apiUrl,
|
||||
logMessage = logMessage
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -9,32 +9,28 @@ package com.navi.common.viewmodel
|
||||
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import androidx.lifecycle.ViewModel
|
||||
import com.navi.analytics.utils.NaviAnalyticsHelper
|
||||
import com.navi.analytics.utils.NaviTrackEvent
|
||||
import com.navi.base.utils.BaseUtils.isNetworkAvailable
|
||||
import com.navi.common.CommonLibManager
|
||||
import com.navi.common.R
|
||||
import com.navi.common.network.ApiConstants.API_BAD_GATEWAY
|
||||
import com.navi.common.network.ApiConstants.API_BAD_REQUEST
|
||||
import com.navi.common.network.ApiConstants.API_CODE_CONNECT_EXCEPTION
|
||||
import com.navi.common.network.ApiConstants.API_CODE_ERROR
|
||||
import com.navi.common.network.ApiConstants.API_CODE_SOCKET_TIMEOUT
|
||||
import com.navi.common.network.ApiConstants.API_CODE_UNKNOWN_HOST
|
||||
import com.navi.common.network.ApiConstants.API_ERROR_NO_USER_FOUND
|
||||
import com.navi.common.network.ApiConstants.API_FORBIDDEN
|
||||
import com.navi.common.network.ApiConstants.API_INTERNAL_SERVER_ERROR
|
||||
import com.navi.common.network.ApiConstants.API_NOT_FOUND
|
||||
import com.navi.common.network.ApiConstants.API_WRONG_ERROR_RESPONSE
|
||||
import com.navi.common.network.ApiConstants.NO_INTERNET
|
||||
import com.navi.common.network.ApiErrorTagType
|
||||
import com.navi.common.network.handleException
|
||||
import com.navi.common.network.models.ErrorMessage
|
||||
import com.navi.common.network.models.GenericErrorResponse
|
||||
import com.navi.common.network.models.GenericWarningResponse
|
||||
import com.navi.common.utils.*
|
||||
import java.net.ConnectException
|
||||
import java.net.SocketTimeoutException
|
||||
import kotlinx.coroutines.CoroutineExceptionHandler
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import timber.log.Timber
|
||||
|
||||
abstract class BaseVM(isExceptionNeedToShow: Boolean = true) : ViewModel() {
|
||||
val errorMessage = MutableLiveData<ErrorMessage>()
|
||||
@@ -59,37 +55,6 @@ abstract class BaseVM(isExceptionNeedToShow: Boolean = true) : ViewModel() {
|
||||
coroutineScope = coroutineScopeTemp
|
||||
}
|
||||
|
||||
private fun handleException(e: Throwable): ErrorMessage {
|
||||
Timber.d(e, "Failure during processing")
|
||||
NaviAnalyticsHelper.recordException(e)
|
||||
val errorMessage = ErrorMessage()
|
||||
|
||||
if (!isNetworkAvailable(CommonLibManager.application)) {
|
||||
errorMessage.message =
|
||||
CommonLibManager.application.resources.getString(R.string.no_internet)
|
||||
errorMessage.statusCode = NO_INTERNET
|
||||
errorMessage.errorTag = ApiErrorTagType.NO_INTERNET_ERROR.value
|
||||
} else if (e is ConnectException) {
|
||||
errorMessage.message =
|
||||
CommonLibManager.application.resources.getString(
|
||||
R.string.check_internet_connectivity
|
||||
)
|
||||
errorMessage.statusCode = API_CODE_SOCKET_TIMEOUT
|
||||
errorMessage.errorTag = ApiErrorTagType.NO_INTERNET_ERROR.value
|
||||
} else if (e is SocketTimeoutException) {
|
||||
errorMessage.message =
|
||||
CommonLibManager.application.resources.getString(R.string.internet_too_slow)
|
||||
errorMessage.statusCode = API_CODE_SOCKET_TIMEOUT
|
||||
errorMessage.errorTag = ApiErrorTagType.NO_INTERNET_ERROR.value
|
||||
NaviTrackEvent.trackEvent(CommonNaviAnalytics.API_CONNECTION_TIMEOUT)
|
||||
} else {
|
||||
errorMessage.message =
|
||||
CommonLibManager.application.resources.getString(R.string.something_went_wrong)
|
||||
errorMessage.statusCode = API_CODE_ERROR
|
||||
}
|
||||
return errorMessage
|
||||
}
|
||||
|
||||
fun updateErrorMessage(
|
||||
error: ErrorMessage?,
|
||||
tag: String? = null,
|
||||
@@ -99,10 +64,15 @@ abstract class BaseVM(isExceptionNeedToShow: Boolean = true) : ViewModel() {
|
||||
val errorTag = tag ?: error?.errorTag
|
||||
errorMessage.value = error
|
||||
when (error?.statusCode) {
|
||||
NO_INTERNET -> {
|
||||
NO_INTERNET, API_CODE_CONNECT_EXCEPTION, API_CODE_UNKNOWN_HOST -> {
|
||||
errorResponse.value =
|
||||
Triple(
|
||||
getNoInternetData(CommonLibManager.application, error.statusCode, apiUrl = error.apiUrl),
|
||||
getNoInternetData(
|
||||
CommonLibManager.application,
|
||||
error.statusCode,
|
||||
apiUrl = error.apiUrl,
|
||||
logMessage = error.message
|
||||
),
|
||||
errorTag,
|
||||
cancelable
|
||||
)
|
||||
@@ -110,7 +80,12 @@ abstract class BaseVM(isExceptionNeedToShow: Boolean = true) : ViewModel() {
|
||||
API_CODE_SOCKET_TIMEOUT -> {
|
||||
errorResponse.value =
|
||||
Triple(
|
||||
getSocketTimeOutData(CommonLibManager.application, error.statusCode, apiUrl = error.apiUrl),
|
||||
getSocketTimeOutData(
|
||||
CommonLibManager.application,
|
||||
error.statusCode,
|
||||
apiUrl = error.apiUrl,
|
||||
logMessage = error.message
|
||||
),
|
||||
errorTag,
|
||||
cancelable
|
||||
)
|
||||
@@ -119,7 +94,12 @@ abstract class BaseVM(isExceptionNeedToShow: Boolean = true) : ViewModel() {
|
||||
if (showFullScreenError) {
|
||||
errorResponse.value =
|
||||
Triple(
|
||||
getApiFailedData(CommonLibManager.application, error.statusCode, apiUrl = error.apiUrl),
|
||||
getApiFailedData(
|
||||
CommonLibManager.application,
|
||||
error.statusCode,
|
||||
apiUrl = error.apiUrl,
|
||||
logMessage = error.message
|
||||
),
|
||||
errorTag,
|
||||
cancelable
|
||||
)
|
||||
@@ -130,7 +110,8 @@ abstract class BaseVM(isExceptionNeedToShow: Boolean = true) : ViewModel() {
|
||||
CommonLibManager.application.resources.getString(R.string.okay),
|
||||
CommonLibManager.application.applicationContext,
|
||||
error.statusCode,
|
||||
apiUrl = error.apiUrl
|
||||
apiUrl = error.apiUrl,
|
||||
logMessage = error.message
|
||||
),
|
||||
errorTag,
|
||||
cancelable
|
||||
@@ -147,7 +128,12 @@ abstract class BaseVM(isExceptionNeedToShow: Boolean = true) : ViewModel() {
|
||||
if (showFullScreenError) {
|
||||
errorResponse.value =
|
||||
Triple(
|
||||
getApiFailedData(CommonLibManager.application, error.statusCode, apiUrl = error.apiUrl),
|
||||
getApiFailedData(
|
||||
CommonLibManager.application,
|
||||
error.statusCode,
|
||||
apiUrl = error.apiUrl,
|
||||
logMessage = error.message
|
||||
),
|
||||
errorTag,
|
||||
cancelable
|
||||
)
|
||||
@@ -157,7 +143,8 @@ abstract class BaseVM(isExceptionNeedToShow: Boolean = true) : ViewModel() {
|
||||
getErrorData(
|
||||
context = CommonLibManager.application,
|
||||
statusCode = error.statusCode,
|
||||
apiUrl = error.apiUrl
|
||||
apiUrl = error.apiUrl,
|
||||
logMessage = error.message
|
||||
),
|
||||
errorTag,
|
||||
cancelable
|
||||
@@ -171,7 +158,8 @@ abstract class BaseVM(isExceptionNeedToShow: Boolean = true) : ViewModel() {
|
||||
getErrorData(
|
||||
context = CommonLibManager.application,
|
||||
statusCode = error?.statusCode,
|
||||
apiUrl = error?.apiUrl
|
||||
apiUrl = error?.apiUrl,
|
||||
logMessage = error?.message
|
||||
),
|
||||
errorTag,
|
||||
cancelable
|
||||
@@ -179,7 +167,12 @@ abstract class BaseVM(isExceptionNeedToShow: Boolean = true) : ViewModel() {
|
||||
} else {
|
||||
errorResponse.value =
|
||||
Triple(
|
||||
getNoInternetData(CommonLibManager.application, error?.statusCode, apiUrl = error?.apiUrl),
|
||||
getNoInternetData(
|
||||
CommonLibManager.application,
|
||||
error?.statusCode,
|
||||
apiUrl = error?.apiUrl,
|
||||
logMessage = error?.message
|
||||
),
|
||||
errorTag,
|
||||
cancelable
|
||||
)
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
/*
|
||||
*
|
||||
* * Copyright © 2023 by Navi Technologies Limited
|
||||
* * All rights reserved. Strictly confidential
|
||||
*
|
||||
*/
|
||||
|
||||
package com.navi.insurance.claim.document.vm
|
||||
|
||||
import androidx.lifecycle.viewModelScope
|
||||
@@ -8,6 +15,7 @@ import com.navi.insurance.claim.repo.DocumentReviewRepository
|
||||
import com.navi.insurance.common.util.ActionHandler
|
||||
import com.navi.insurance.common.GiBaseVM
|
||||
import com.navi.common.di.CoroutineDispatcherProvider
|
||||
import com.navi.common.network.handleException
|
||||
import com.navi.insurance.common.models.*
|
||||
import com.navi.insurance.network.ApiErrorTagType
|
||||
import com.navi.insurance.util.orFalse
|
||||
@@ -154,4 +162,4 @@ constructor(
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
/*
|
||||
*
|
||||
* * Copyright © 2023 by Navi Technologies Limited
|
||||
* * All rights reserved. Strictly confidential
|
||||
*
|
||||
*/
|
||||
|
||||
package com.navi.insurance.claim.document.vm
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
@@ -5,6 +12,7 @@ import androidx.lifecycle.viewModelScope
|
||||
import com.navi.base.utils.isNull
|
||||
import com.navi.common.awsupload.helper.AWSUploadHelper
|
||||
import com.navi.common.di.CoroutineDispatcherProvider
|
||||
import com.navi.common.network.handleException
|
||||
import com.navi.insurance.claim.document.states.DocumentUploadByCategoryState
|
||||
import com.navi.insurance.claim.document.states.DocumentUploadStatus
|
||||
import com.navi.insurance.claim.document.states.UploadCardsListViewState
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* * Copyright © 2022 by Navi Technologies Limited
|
||||
* * Copyright © 2022-2023 by Navi Technologies Limited
|
||||
* * All rights reserved. Strictly confidential
|
||||
*
|
||||
*/
|
||||
@@ -9,6 +9,7 @@ package com.navi.insurance.common
|
||||
|
||||
import com.navi.base.model.CtaData
|
||||
import com.navi.common.model.ModuleName
|
||||
import com.navi.common.network.handleException
|
||||
import com.navi.common.network.models.ErrorMessage
|
||||
import com.navi.common.network.models.RepoResult
|
||||
import com.navi.common.utils.CommonNaviAnalytics
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
/*
|
||||
*
|
||||
* * Copyright © 2022 by Navi Technologies Private Limited
|
||||
* * Copyright © 2022-2023 by Navi Technologies Limited
|
||||
* * All rights reserved. Strictly confidential
|
||||
*
|
||||
*/
|
||||
|
||||
package com.navi.insurance.external_porting.view_model
|
||||
|
||||
import androidx.lifecycle.viewModelScope
|
||||
@@ -12,6 +13,7 @@ import com.navi.insurance.common.GiBaseVM
|
||||
import com.navi.insurance.common.models.UploadedDocData
|
||||
import com.navi.insurance.common.util.ActionHandler
|
||||
import com.navi.common.di.CoroutineDispatcherProvider
|
||||
import com.navi.common.network.handleException
|
||||
import com.navi.insurance.external_porting.repo.PolicyDocumentUploadRepository
|
||||
import com.navi.insurance.external_porting.states.PolicyDocumentReviewState
|
||||
import com.navi.insurance.network.ApiErrorTagType
|
||||
@@ -109,4 +111,4 @@ constructor(
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
/*
|
||||
*
|
||||
* * Copyright © 2022 by Navi Technologies Private Limited
|
||||
* * Copyright © 2022-2023 by Navi Technologies Limited
|
||||
* * All rights reserved. Strictly confidential
|
||||
*
|
||||
*/
|
||||
|
||||
package com.navi.insurance.external_porting.view_model
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
@@ -11,6 +12,7 @@ import androidx.lifecycle.viewModelScope
|
||||
import com.navi.base.utils.isNull
|
||||
import com.navi.common.awsupload.helper.AWSUploadHelper
|
||||
import com.navi.common.di.CoroutineDispatcherProvider
|
||||
import com.navi.common.network.handleException
|
||||
import com.navi.insurance.claim.document.states.DocumentUploadStatus
|
||||
import com.navi.insurance.claim.document.states.UploadCardsListViewState
|
||||
import com.navi.insurance.common.GiBaseVM
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* * Copyright © 2019-2022 by Navi Technologies Limited
|
||||
* * Copyright © 2019-2023 by Navi Technologies Limited
|
||||
* * All rights reserved. Strictly confidential
|
||||
*
|
||||
*/
|
||||
@@ -16,6 +16,9 @@ import com.navi.base.model.CtaData
|
||||
import com.navi.base.sharedpref.PreferenceManager
|
||||
import com.navi.common.deeplink.DeepLinkManager
|
||||
import com.navi.common.deeplink.util.DeeplinkConstants
|
||||
import com.navi.common.network.ApiConstants.API_CODE_ERROR
|
||||
import com.navi.common.network.ApiConstants.API_CODE_SOCKET_TIMEOUT
|
||||
import com.navi.common.network.ApiConstants.NO_INTERNET
|
||||
import com.navi.common.network.models.ErrorMessage
|
||||
import com.navi.insurance.R
|
||||
import com.navi.insurance.analytics.InsuranceAnalyticsConstants
|
||||
@@ -76,19 +79,19 @@ class ErrorFragment : BaseFragment(), View.OnClickListener {
|
||||
|
||||
if (err != null) {
|
||||
when (err!!.statusCode) {
|
||||
ApiConstants.NO_INTERNET -> {
|
||||
NO_INTERNET -> {
|
||||
binding.networkError.visibility = View.VISIBLE
|
||||
binding.errorTitle.text = "No internet connection!"
|
||||
binding.errorDescription.text =
|
||||
"Please check your internet connectivity and try again"
|
||||
}
|
||||
ApiConstants.API_CODE_SOCKET_TIMEOUT -> {
|
||||
API_CODE_SOCKET_TIMEOUT -> {
|
||||
binding.networkError.visibility = View.VISIBLE
|
||||
binding.errorTitle.text = "Internet is slow"
|
||||
binding.errorDescription.text =
|
||||
"Please check your internet connectivity and try again"
|
||||
}
|
||||
ApiConstants.API_CODE_ERROR -> {
|
||||
API_CODE_ERROR -> {
|
||||
binding.serverError.visibility = View.VISIBLE
|
||||
binding.errorTitle.text = "Something went wrong!"
|
||||
binding.errorDescription.text = "Please try again after sometime"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* * Copyright © 2019-2022 by Navi Technologies Limited
|
||||
* * Copyright © 2019-2023 by Navi Technologies Limited
|
||||
* * All rights reserved. Strictly confidential
|
||||
*
|
||||
*/
|
||||
@@ -9,19 +9,13 @@ package com.navi.insurance.health.viewmodel
|
||||
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import androidx.lifecycle.ViewModel
|
||||
import com.navi.common.network.ApiConstants.API_CODE_SOCKET_TIMEOUT
|
||||
import com.navi.common.network.ApiConstants.NO_INTERNET
|
||||
import com.navi.common.network.handleException
|
||||
import com.navi.common.network.models.ErrorMessage
|
||||
import com.navi.common.network.models.GenericErrorResponse
|
||||
import com.navi.insurance.GILibManager
|
||||
import com.navi.insurance.R
|
||||
import com.navi.insurance.network.ApiConstants.API_CODE_ERROR
|
||||
import com.navi.insurance.network.ApiConstants.API_CODE_SOCKET_TIMEOUT
|
||||
import com.navi.insurance.network.ApiConstants.NO_INTERNET
|
||||
import com.navi.insurance.network.ApiErrorTagType
|
||||
import com.navi.insurance.util.SingleEvent
|
||||
import com.navi.insurance.util.isNetworkAvailable
|
||||
import com.navi.insurance.util.orZero
|
||||
import java.net.ConnectException
|
||||
import java.net.SocketTimeoutException
|
||||
import kotlinx.coroutines.CoroutineExceptionHandler
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
@@ -50,38 +44,6 @@ abstract class BaseVM(isExceptionNeedToShow: Boolean = true) : ViewModel() {
|
||||
coroutineScope = coroutineScopeTemp
|
||||
}
|
||||
|
||||
protected fun handleException(e: Throwable?, tag: String? = null): ErrorMessage {
|
||||
val errorMessage = ErrorMessage()
|
||||
|
||||
if (!isNetworkAvailable()) {
|
||||
errorMessage.message = GILibManager.application.getString(R.string.no_internet)
|
||||
errorMessage.statusCode = NO_INTERNET
|
||||
errorMessage.errorTag = tag ?: ApiErrorTagType.NO_INTERNET_ERROR.value
|
||||
} else if (e is ConnectException) {
|
||||
errorMessage.message =
|
||||
GILibManager.application.applicationContext.getString(
|
||||
R.string.check_internet_connectivity
|
||||
)
|
||||
errorMessage.statusCode = API_CODE_SOCKET_TIMEOUT
|
||||
errorMessage.errorTag = tag ?: ApiErrorTagType.NO_INTERNET_ERROR.value
|
||||
} else if (e is SocketTimeoutException) {
|
||||
errorMessage.message =
|
||||
GILibManager.application.applicationContext.getString(R.string.internet_too_slow)
|
||||
errorMessage.statusCode = API_CODE_SOCKET_TIMEOUT
|
||||
errorMessage.errorTag = tag ?: ApiErrorTagType.NO_INTERNET_ERROR.value
|
||||
} else {
|
||||
errorMessage.message =
|
||||
GILibManager.application.applicationContext.getString(R.string.something_went_wrong)
|
||||
errorMessage.statusCode = API_CODE_ERROR
|
||||
errorMessage.errorTag = tag
|
||||
}
|
||||
|
||||
errorMessage.exception =
|
||||
"Message : ${e?.message}, Cause : ${e?.cause}, StackTrace : ${e?.stackTrace?.getOrNull(0)}"
|
||||
|
||||
return errorMessage
|
||||
}
|
||||
|
||||
fun updateErrorMessage(error: ErrorMessage?, tag: String? = null, cancelable: Boolean = true) {
|
||||
val errorTag = tag ?: error?.errorTag
|
||||
error?.errorTag = errorTag
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* * Copyright © 2022 by Navi Technologies Limited
|
||||
* * Copyright © 2022-2023 by Navi Technologies Limited
|
||||
* * All rights reserved. Strictly confidential
|
||||
*
|
||||
*/
|
||||
@@ -9,6 +9,7 @@ package com.navi.insurance.health.viewmodel
|
||||
|
||||
import androidx.lifecycle.viewModelScope
|
||||
import com.navi.common.di.CoroutineDispatcherProvider
|
||||
import com.navi.common.network.handleException
|
||||
import com.navi.common.network.models.RepoResult
|
||||
import com.navi.insurance.common.GiBaseVM
|
||||
import com.navi.insurance.common.util.ActionHandler
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* * Copyright © 2019-2022 by Navi Technologies Limited
|
||||
* * Copyright © 2019-2023 by Navi Technologies Limited
|
||||
* * All rights reserved. Strictly confidential
|
||||
*
|
||||
*/
|
||||
@@ -16,9 +16,6 @@ object ApiConstants {
|
||||
const val API_CONNECT_TIMEOUT_VALUE = 30L
|
||||
const val API_SUCCESS_CODE = 200
|
||||
const val API_ERROR_NO_USER_FOUND = 401
|
||||
const val API_CODE_ERROR = -100
|
||||
const val NO_INTERNET = -200
|
||||
const val API_CODE_SOCKET_TIMEOUT = -101
|
||||
const val API_NOT_FOUND = 404
|
||||
const val API_FORBIDDEN = 403
|
||||
const val API_TOO_MANY_REQUESTS = 429
|
||||
|
||||
@@ -40,6 +40,9 @@ import com.google.gson.GsonBuilder
|
||||
import com.google.gson.reflect.TypeToken
|
||||
import com.navi.base.model.CtaData
|
||||
import com.navi.common.constants.*
|
||||
import com.navi.common.network.ApiConstants.API_CODE_ERROR
|
||||
import com.navi.common.network.ApiConstants.API_CODE_SOCKET_TIMEOUT
|
||||
import com.navi.common.network.ApiConstants.NO_INTERNET
|
||||
import com.navi.common.network.models.ErrorMessage
|
||||
import com.navi.common.network.models.RepoResult
|
||||
import com.navi.common.utils.CommonNaviAnalytics
|
||||
@@ -553,9 +556,9 @@ fun String.getDateOrdinal(): String {
|
||||
|
||||
fun getGlobalErrorType(errorCode: Int?): String {
|
||||
return if (
|
||||
errorCode == ApiConstants.NO_INTERNET ||
|
||||
errorCode == ApiConstants.API_CODE_SOCKET_TIMEOUT ||
|
||||
errorCode == ApiConstants.API_CODE_ERROR ||
|
||||
errorCode == NO_INTERNET ||
|
||||
errorCode == API_CODE_SOCKET_TIMEOUT ||
|
||||
errorCode == API_CODE_ERROR ||
|
||||
errorCode == ApiConstants.API_ERROR_NO_USER_FOUND ||
|
||||
errorCode == ApiConstants.API_NOT_FOUND ||
|
||||
errorCode == ApiConstants.API_FORBIDDEN ||
|
||||
|
||||
Reference in New Issue
Block a user