Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cash-loan-flow-boss
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
胡慧
cash-loan-flow-boss
Commits
8d4380e9
Commit
8d4380e9
authored
Aug 06, 2019
by
xiaozhe.chen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
暂时修改一下这个方法吧generalException
parent
c61f2a2f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
ApplicationExceptionConfiguration.java
...core/configuration/ApplicationExceptionConfiguration.java
+10
-3
No files found.
src/main/java/cn/quantgroup/cashloanflowboss/core/configuration/ApplicationExceptionConfiguration.java
View file @
8d4380e9
...
@@ -94,18 +94,25 @@ public class ApplicationExceptionConfiguration {
...
@@ -94,18 +94,25 @@ public class ApplicationExceptionConfiguration {
*/
*/
@ExceptionHandler
({
Throwable
.
class
})
@ExceptionHandler
({
Throwable
.
class
})
public
Result
generalException
(
Throwable
e
)
{
public
Result
generalException
(
Throwable
e
)
{
Throwable
parent
;
Throwable
child
=
e
.
getCause
();
Throwable
cause
=
e
.
getCause
();
while
(
Objects
.
nonNull
(
child
))
{
parent
=
child
;
child
=
parent
.
getCause
();
}
return
new
Result
<>(
ApplicationStatus
.
INTERNAL_SERVICE_ERROR
,
child
.
getMessage
());
/*
while (Objects.nonNull(cause.getCause())) {
while (Objects.nonNull(cause.getCause())) {
if (cause instanceof ApplicationException) { //todo 如果抛出的不是ApplicationException,是不是就成了死循环
if (cause instanceof ApplicationException) { //todo 如果抛出的不是ApplicationException,是不是就成了死循环
cause = cause.getCause();
cause = cause.getCause();
}
}
}
}
return new Result<>(ApplicationStatus.INTERNAL_SERVICE_ERROR, cause.getMessage());
return new Result<>(ApplicationStatus.INTERNAL_SERVICE_ERROR, cause.getMessage());
*/
}
}
}
}
\ 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