|
|
@@ -20,6 +20,7 @@ import com.grkj.iscs.model.UrlConsts
|
|
|
import com.grkj.iscs.model.UrlConsts.LOGIN_CARD
|
|
|
import com.grkj.iscs.util.log.LogUtil
|
|
|
import okhttp3.logging.HttpLoggingInterceptor
|
|
|
+import java.io.IOException
|
|
|
import java.net.SocketTimeoutException
|
|
|
import java.util.concurrent.TimeUnit
|
|
|
|
|
|
@@ -58,6 +59,11 @@ class NetHttpManager {
|
|
|
}
|
|
|
true
|
|
|
}
|
|
|
+ .exceptionListener { task: HttpTask<*>, error: IOException? ->
|
|
|
+ LogUtil.e("Network request exception : ${error?.message}")
|
|
|
+ ToastUtils.tip(error?.message)
|
|
|
+ true
|
|
|
+ }
|
|
|
.config {
|
|
|
it.addInterceptor(HttpLoggingInterceptor().setLevel(HttpLoggingInterceptor.Level.BODY))
|
|
|
}
|