Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
open-source
/
open-platform-admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 74da30e3
authored
Dec 18, 2020
by
杨林龙
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into dev
2 parents
c9e31fcf
ed1f6f6c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
src/main/java/com/glsx/exception/GlobalExceptionHandler.java
src/main/java/com/glsx/exception/GlobalExceptionHandler.java
View file @
74da30e
package
com
.
glsx
.
exception
;
package
com
.
glsx
.
exception
;
import
javax.servlet.ServletException
;
import
cn.com.glsx.openplatform.enums.ResultCodeEnum
;
import
cn.com.glsx.openplatform.enums.ResultCodeEnum
;
import
cn.com.glsx.openplatform.exception.BusinessException
;
import
cn.com.glsx.openplatform.exception.BusinessException
;
import
cn.com.glsx.openplatform.vo.R
;
import
cn.com.glsx.openplatform.vo.R
;
...
@@ -25,10 +26,15 @@ public class GlobalExceptionHandler {
...
@@ -25,10 +26,15 @@ public class GlobalExceptionHandler {
return
R
.
error
(
e
.
getCode
(),
e
.
getMessage
());
return
R
.
error
(
e
.
getCode
(),
e
.
getMessage
());
}
}
@ExceptionHandler
({
ServletException
.
class
})
public
R
handleRequestException
(
ServletException
e
)
{
this
.
logger
.
error
(
"!!!! ERROR"
,
e
);
return
R
.
error
(
ResultCodeEnum
.
REQUEST_ERROR
);
}
@ExceptionHandler
({
Throwable
.
class
})
@ExceptionHandler
({
Throwable
.
class
})
public
R
handlerOtherException
(
Throwable
e
)
{
public
R
handlerOtherException
(
Throwable
e
)
{
this
.
logger
.
error
(
"!!!! ERROR"
,
e
);
this
.
logger
.
error
(
"!!!! ERROR"
,
e
);
return
R
.
error
(
ResultCodeEnum
.
SERVER_ERROR
.
getCode
(),
return
R
.
error
(
ResultCodeEnum
.
SERVER_ERROR
);
ResultCodeEnum
.
SERVER_ERROR
.
getMsg
());
}
}
}
}
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