增加异常日志记录,接口报错提示,app启动时有网络不再进行倒计时处理
This commit is contained in:
@@ -2,6 +2,7 @@ package com.sw.inbound.repository
|
||||
|
||||
import com.google.gson.JsonParseException
|
||||
import com.sw.inbound.model.response.ApiResponse
|
||||
import com.sw.inbound.utils.LogSaveUtil
|
||||
import retrofit2.HttpException
|
||||
import timber.log.Timber
|
||||
import java.io.IOException
|
||||
@@ -15,7 +16,7 @@ abstract class BaseRepository {
|
||||
apiCall()
|
||||
} catch (e: Exception) {
|
||||
Timber.e("safeApiCall Exception: ${e.stackTraceToString()}")
|
||||
|
||||
LogSaveUtil.saveLogFile("safeApiCall Exception: ${e.stackTraceToString()}")
|
||||
when (e) {
|
||||
is HttpException -> {
|
||||
// 对于HTTP异常,尝试从响应体中获取错误信息
|
||||
|
||||
Reference in New Issue
Block a user