浏览代码

不初始化发生异常也打印日志

drake 4 年之前
父节点
当前提交
000468a689
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      net/src/main/java/com/drake/net/NetConfig.kt

+ 1 - 1
net/src/main/java/com/drake/net/NetConfig.kt

@@ -62,6 +62,7 @@ object NetConfig {
     }
 
     var onError: Throwable.() -> Unit = onError@{
+        if (logEnabled) printStackTrace()
         if (!this@NetConfig::app.isInitialized) return@onError
 
         val message = when (this) {
@@ -84,7 +85,6 @@ object NetConfig {
             else -> app.getString(R.string.net_other_error)
         }
 
-        if (logEnabled) printStackTrace()
         app.toast(message)
     }