Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
smart_gov_platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
smart_gov_platform
Commits
8a27fb64
Commit
8a27fb64
authored
Oct 09, 2024
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交配置校验
parent
1b00f31a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
8 deletions
+4
-8
base-manager/src/main/java/com/mortals/xhx/base/framework/exception/ExceptionHandle.java
...mortals/xhx/base/framework/exception/ExceptionHandle.java
+0
-2
portal-manager/src/main/java/com/mortals/xhx/base/framework/exception/ExceptionHandle.java
...mortals/xhx/base/framework/exception/ExceptionHandle.java
+4
-6
No files found.
base-manager/src/main/java/com/mortals/xhx/base/framework/exception/ExceptionHandle.java
View file @
8a27fb64
...
@@ -25,8 +25,6 @@ import javax.servlet.http.HttpServletResponse;
...
@@ -25,8 +25,6 @@ import javax.servlet.http.HttpServletResponse;
@Slf4j
@Slf4j
public
class
ExceptionHandle
{
public
class
ExceptionHandle
{
@Autowired
private
HttpServletRequest
request
;
@Autowired
@Autowired
private
HttpServletResponse
response
;
private
HttpServletResponse
response
;
...
...
portal-manager/src/main/java/com/mortals/xhx/base/framework/exception/ExceptionHandle.java
View file @
8a27fb64
...
@@ -7,6 +7,7 @@ import com.mortals.framework.exception.AppException;
...
@@ -7,6 +7,7 @@ import com.mortals.framework.exception.AppException;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.converter.HttpMessageNotReadableException
;
import
org.springframework.http.converter.HttpMessageNotReadableException
;
import
org.springframework.messaging.handler.annotation.support.MethodArgumentTypeMismatchException
;
import
org.springframework.web.bind.annotation.ControllerAdvice
;
import
org.springframework.web.bind.annotation.ControllerAdvice
;
import
org.springframework.web.bind.annotation.ExceptionHandler
;
import
org.springframework.web.bind.annotation.ExceptionHandler
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.ResponseBody
;
...
@@ -21,8 +22,6 @@ import javax.servlet.http.HttpServletResponse;
...
@@ -21,8 +22,6 @@ import javax.servlet.http.HttpServletResponse;
@Slf4j
@Slf4j
public
class
ExceptionHandle
{
public
class
ExceptionHandle
{
@Autowired
private
HttpServletRequest
request
;
@Autowired
@Autowired
private
HttpServletResponse
response
;
private
HttpServletResponse
response
;
...
@@ -43,14 +42,13 @@ public class ExceptionHandle {
...
@@ -43,14 +42,13 @@ public class ExceptionHandle {
stack
.
getClassName
(),
stack
.
getMethodName
(),
stack
.
getLineNumber
(),
e
.
getClass
().
getName
());
stack
.
getClassName
(),
stack
.
getMethodName
(),
stack
.
getLineNumber
(),
e
.
getClass
().
getName
());
AppException
ex
=
(
AppException
)
e
;
AppException
ex
=
(
AppException
)
e
;
ret
.
put
(
KEY_RESULT_MSG
,
ex
.
getMessage
());
ret
.
put
(
KEY_RESULT_MSG
,
ex
.
getMessage
());
}
}
else
if
(
e
instanceof
HttpMessageNotReadableException
||
e
instanceof
MethodArgumentTypeMismatchException
)
{
if
(
e
instanceof
HttpMessageNotReadableException
)
{
log
.
error
(
"[system error]"
,
e
);
log
.
error
(
"[system error]"
,
e
);
response
.
setStatus
(
HttpStatus
.
HTTP_BAD_REQUEST
);
response
.
setStatus
(
HttpStatus
.
HTTP_BAD_REQUEST
);
ret
.
put
(
KEY_RESULT_MSG
,
"参数错误,"
+
StrUtil
.
subBefore
(
e
.
getMessage
(),
";"
,
false
));
ret
.
put
(
KEY_RESULT_MSG
,
"参数错误,"
+
StrUtil
.
subBefore
(
e
.
getMessage
(),
";"
,
false
));
}
else
{
}
else
{
log
.
error
(
"[system error]"
,
e
);
log
.
error
(
"[system error]"
,
e
);
response
.
setStatus
(
HttpStatus
.
HTTP_
INTERNAL_ERROR
);
response
.
setStatus
(
HttpStatus
.
HTTP_
BAD_REQUEST
);
ret
.
put
(
KEY_RESULT_MSG
,
"未知错误!"
+
e
.
getMessage
());
ret
.
put
(
KEY_RESULT_MSG
,
"未知错误!"
+
e
.
getMessage
());
}
}
return
ret
.
toJSONString
();
return
ret
.
toJSONString
();
...
...
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