Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
architecture
/
glsx-archetype
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 45f3a9c5
authored
Apr 10, 2023
by
黄超华
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
返回异常消息
1 parent
17900e48
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 additions
and
2 deletions
rest-archetype-framework/rest-admin-web/src/main/java/com/glsx/plat/web/advice/ResponseResultBodyAdvice.java
rest-archetype-framework/rest-admin-web/src/main/java/com/glsx/plat/web/advice/ResponseResultBodyAdvice.java
View file @
45f3a9c
...
...
@@ -85,10 +85,9 @@ public class ResponseResultBodyAdvice implements ResponseBodyAdvice<Object> {
* 异常类的统一处理
*/
protected
ResponseEntity
<
Result
<?>>
handleException
(
Exception
ex
,
HttpHeaders
headers
,
WebRequest
request
)
{
Result
<?>
body
=
Result
.
failure
();
//返回异常消息
body
.
setMessage
(
ex
.
getMessage
());
HttpStatus
status
=
HttpStatus
.
INTERNAL_SERVER_ERROR
;
Result
<?>
body
=
new
Result
(
status
.
value
(),
ex
.
getMessage
());
return
this
.
handleExceptionInternal
(
ex
,
body
,
headers
,
status
,
request
);
}
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment