Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
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
项目统一框架
amos-boot-biz
Commits
d0e10279
Commit
d0e10279
authored
Dec 26, 2021
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.修改错误
parent
5860c7b7
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
FeignErrorDecoder.java
...java/com/yeejoin/equipmanage/fegin/FeignErrorDecoder.java
+8
-6
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/fegin/FeignErrorDecoder.java
View file @
d0e10279
...
...
@@ -4,24 +4,26 @@ import com.alibaba.fastjson.JSONObject;
import
feign.Response
;
import
feign.Util
;
import
feign.codec.ErrorDecoder
;
import
lombok.extern.slf4j.Slf4j
;
import
java.io.IOException
;
/**
* @author DELL
*/
@Slf4j
public
class
FeignErrorDecoder
implements
ErrorDecoder
{
@Override
public
Exception
decode
(
String
s
,
Response
response
)
{
public
Exception
decode
(
String
methodKey
,
Response
response
)
{
String
msg
=
null
;
try
{
msg
=
Util
.
toString
(
response
.
body
().
asReader
());
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
msg
=
Util
.
toString
(
response
.
body
().
asReader
(
Util
.
UTF_8
));
JSONObject
object
=
JSONObject
.
parseObject
(
msg
);
throw
new
RuntimeException
(
object
.
get
(
"devMessage"
).
toString
());
}
catch
(
IOException
e
)
{
log
.
error
(
"feign 调用失败"
+
e
.
getMessage
());
}
throw
new
RuntimeException
(
methodKey
+
"远程调用失败"
);
}
}
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