增加异常日志记录,接口报错提示,app启动时有网络不再进行倒计时处理

This commit is contained in:
mazengfei
2026-03-23 10:12:11 +08:00
parent 8a83de3238
commit 441d40b584
5 changed files with 23 additions and 7 deletions
@@ -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异常,尝试从响应体中获取错误信息