Commit 443130dd authored by 王雷's avatar 王雷

修改fetch库异常信息

parent f23d304c
...@@ -63,7 +63,7 @@ repositories { ...@@ -63,7 +63,7 @@ repositories {
mavenCentral() mavenCentral()
} }
group 'com.qmai.android.fetch' group 'com.qmai.android.fetch'
version '1.2.61-SNAPSHOT' version '1.2.62-SNAPSHOT'
gradlePublish { gradlePublish {
......
...@@ -144,7 +144,7 @@ class KotlinCoroutinesCallAdapterFactory( ...@@ -144,7 +144,7 @@ class KotlinCoroutinesCallAdapterFactory(
//业务逻辑错误 //业务逻辑错误
if (t is BizException) { if (t is BizException) {
serverError?.apply { serverError?.apply {
this.serverError( this.serverError(request.url().toString(),
"${t.message}", "${t.message}",
gson.toJson(requestStartMessage), gson.toJson(requestStartMessage),
t.responseMsg t.responseMsg
...@@ -154,7 +154,7 @@ class KotlinCoroutinesCallAdapterFactory( ...@@ -154,7 +154,7 @@ class KotlinCoroutinesCallAdapterFactory(
} else if (t is GsonParseErrorException) { } else if (t is GsonParseErrorException) {
//gson解析异常 //gson解析异常
gsonParseError?.apply { gsonParseError?.apply {
this.parseError( this.parseError(request.url().toString(),
"${t.message}", "${t.message}",
gson.toJson(requestStartMessage), gson.toJson(requestStartMessage),
t.responseMsg t.responseMsg
...@@ -162,7 +162,7 @@ class KotlinCoroutinesCallAdapterFactory( ...@@ -162,7 +162,7 @@ class KotlinCoroutinesCallAdapterFactory(
} }
} else if (t is ServerResponseException) { } else if (t is ServerResponseException) {
serverError?.apply { serverError?.apply {
this.serverError( this.serverError(request.url().toString(),
"${t.message}", "${t.message}",
gson.toJson(requestStartMessage), gson.toJson(requestStartMessage),
t.responseMsg t.responseMsg
......
...@@ -4,5 +4,5 @@ package com.qimai.android.fetch.interceptors ...@@ -4,5 +4,5 @@ package com.qimai.android.fetch.interceptors
* json解析异常 * json解析异常
*/ */
interface GsonParseError { interface GsonParseError {
fun parseError(msg: String? = null,requestMsg:String?=null,responseMsg:String?=null) fun parseError(url:String,msg: String? = null,requestMsg:String?=null,responseMsg:String?=null)
} }
\ No newline at end of file
...@@ -4,6 +4,6 @@ package com.qimai.android.fetch.interceptors ...@@ -4,6 +4,6 @@ package com.qimai.android.fetch.interceptors
* 服务器返回的false * 服务器返回的false
*/ */
interface ServerError { interface ServerError {
fun serverError(msg: String? = null,requestMsg:String?=null,responseMsg:String?=null) fun serverError(url:String?,msg: String? = null,requestMsg:String?=null,responseMsg:String?=null)
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment