Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
Widget
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Android Widget
Widget
Commits
443130dd
Commit
443130dd
authored
Oct 26, 2022
by
王雷
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改fetch库异常信息
parent
f23d304c
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
6 deletions
+6
-6
build.gradle
fetch/build.gradle
+1
-1
KotlinCoroutinesCallAdapterFactory.kt
...d/fetch/callAdapter/KotlinCoroutinesCallAdapterFactory.kt
+3
-3
GsonParseError.kt
...va/com/qimai/android/fetch/interceptors/GsonParseError.kt
+1
-1
ServerError.kt
.../java/com/qimai/android/fetch/interceptors/ServerError.kt
+1
-1
No files found.
fetch/build.gradle
View file @
443130dd
...
...
@@ -63,7 +63,7 @@ repositories {
mavenCentral
()
}
group
'com.qmai.android.fetch'
version
'1.2.6
1
-SNAPSHOT'
version
'1.2.6
2
-SNAPSHOT'
gradlePublish
{
...
...
fetch/src/main/java/com/qimai/android/fetch/callAdapter/KotlinCoroutinesCallAdapterFactory.kt
View file @
443130dd
...
...
@@ -144,7 +144,7 @@ class KotlinCoroutinesCallAdapterFactory(
//业务逻辑错误
if
(
t
is
BizException
)
{
serverError
?.
apply
{
this
.
serverError
(
this
.
serverError
(
request
.
url
().
toString
(),
"${t.message}"
,
gson
.
toJson
(
requestStartMessage
),
t
.
responseMsg
...
...
@@ -154,7 +154,7 @@ class KotlinCoroutinesCallAdapterFactory(
}
else
if
(
t
is
GsonParseErrorException
)
{
//gson解析异常
gsonParseError
?.
apply
{
this
.
parseError
(
this
.
parseError
(
request
.
url
().
toString
(),
"${t.message}"
,
gson
.
toJson
(
requestStartMessage
),
t
.
responseMsg
...
...
@@ -162,7 +162,7 @@ class KotlinCoroutinesCallAdapterFactory(
}
}
else
if
(
t
is
ServerResponseException
)
{
serverError
?.
apply
{
this
.
serverError
(
this
.
serverError
(
request
.
url
().
toString
(),
"${t.message}"
,
gson
.
toJson
(
requestStartMessage
),
t
.
responseMsg
...
...
fetch/src/main/java/com/qimai/android/fetch/interceptors/GsonParseError.kt
View file @
443130dd
...
...
@@ -4,5 +4,5 @@ package com.qimai.android.fetch.interceptors
* json解析异常
*/
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
fetch/src/main/java/com/qimai/android/fetch/interceptors/ServerError.kt
View file @
443130dd
...
...
@@ -4,6 +4,6 @@ package com.qimai.android.fetch.interceptors
* 服务器返回的false
*/
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment