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 ed1f6f6c
authored
Dec 18, 2020
by
tyfanchz
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
添加参数校验异常信息
1 parent
d58a67b9
Hide 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 @
ed1f6f6
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