Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-platform-enterprise
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
base_platform_enterprise
gic-platform-enterprise
Commits
6ed3903c
Commit
6ed3903c
authored
Jul 16, 2019
by
guojuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
错误吗调整
parent
45d86452
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
7 deletions
+7
-7
pom.xml
gic-platform-enterprise-service/pom.xml
+1
-1
GlobalExceptionHandler.java
.../gic/enterprise/web/exception/GlobalExceptionHandler.java
+3
-3
GlobalExceptionHandler.java
...m/gic/operation/web/exception/GlobalExceptionHandler.java
+3
-3
No files found.
gic-platform-enterprise-service/pom.xml
View file @
6ed3903c
...
...
@@ -23,7 +23,7 @@
<gic-store-api>
4.0-SNAPSHOT
</gic-store-api>
<gic-redis-data>
4.0-SNAPSHOT
</gic-redis-data>
<gic-bizdict-api>
4.0.0-SNAPSHOT
</gic-bizdict-api>
<gic-platform-enterprise-api>
4.0
.0
-SNAPSHOT
</gic-platform-enterprise-api>
<gic-platform-enterprise-api>
4.0-SNAPSHOT
</gic-platform-enterprise-api>
</properties>
<dependencies>
...
...
gic-platform-enterprise-web/src/main/java/com/gic/enterprise/web/exception/GlobalExceptionHandler.java
View file @
6ed3903c
package
com
.
gic
.
enterprise
.
web
.
exception
;
import
com.gic.commons.webapi.reponse.RestResponse
;
import
com.gic.enterprise.error.ErrorCode
;
import
com.gic.store.constant.StoreGroupErrorEnum
;
import
com.gic.store.exception.StoreException
;
import
com.gic.store.exception.StoreGroupException
;
import
com.gic.store.utils.ErrorCode
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.validation.BindException
;
...
...
@@ -34,7 +34,7 @@ public class GlobalExceptionHandler {
@ExceptionHandler
(
Exception
.
class
)
public
RestResponse
controllerException
(
HttpServletResponse
response
,
Exception
ex
)
{
logger
.
error
(
"err"
,
ex
);
RestResponse
failureResponse
=
getRestResponse
(
ErrorCode
.
ERR_3
.
getCode
(),
ErrorCode
.
ERR_3
.
getMsg
());
RestResponse
failureResponse
=
getRestResponse
(
ErrorCode
.
SYSTEM_ERROR
.
getCode
(),
ErrorCode
.
SYSTEM_ERROR
.
getMsg
());
StringBuilder
sb
=
new
StringBuilder
();
ByteArrayOutputStream
baos
=
new
ByteArrayOutputStream
();
try
(
PrintWriter
printWriter
=
new
PrintWriter
(
baos
))
{
...
...
@@ -76,7 +76,7 @@ public class GlobalExceptionHandler {
Set
<
ConstraintViolation
<?>>
constraintViolations
=
e
.
getConstraintViolations
();
String
paramName
=
constraintViolations
.
iterator
().
next
().
getPropertyPath
().
toString
();
String
paramError
=
constraintViolations
.
iterator
().
next
().
getMessage
();
return
getRestResponse
(
com
.
gic
.
enterprise
.
error
.
ErrorCode
.
ERR_5
.
getCode
(),
getFailFastMsg
(
paramName
,
paramError
));
return
getRestResponse
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
getFailFastMsg
(
paramName
,
paramError
));
}
/**
...
...
gic-platform-operation-web/src/main/java/com/gic/operation/web/exception/GlobalExceptionHandler.java
View file @
6ed3903c
package
com
.
gic
.
operation
.
web
.
exception
;
import
com.gic.commons.webapi.reponse.RestResponse
;
import
com.gic.enterprise.error.ErrorCode
;
import
com.gic.store.constant.StoreGroupErrorEnum
;
import
com.gic.store.exception.StoreException
;
import
com.gic.store.exception.StoreGroupException
;
import
com.gic.store.utils.ErrorCode
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.validation.BindException
;
...
...
@@ -34,7 +34,7 @@ public class GlobalExceptionHandler {
@ExceptionHandler
(
Exception
.
class
)
public
RestResponse
controllerException
(
HttpServletResponse
response
,
Exception
ex
)
{
logger
.
error
(
"err"
,
ex
);
RestResponse
failureResponse
=
getRestResponse
(
ErrorCode
.
ERR_3
.
getCode
(),
ErrorCode
.
ERR_3
.
getMsg
());
RestResponse
failureResponse
=
getRestResponse
(
ErrorCode
.
SYSTEM_ERROR
.
getCode
(),
ErrorCode
.
SYSTEM_ERROR
.
getMsg
());
StringBuilder
sb
=
new
StringBuilder
();
ByteArrayOutputStream
baos
=
new
ByteArrayOutputStream
();
try
(
PrintWriter
printWriter
=
new
PrintWriter
(
baos
))
{
...
...
@@ -76,7 +76,7 @@ public class GlobalExceptionHandler {
Set
<
ConstraintViolation
<?>>
constraintViolations
=
e
.
getConstraintViolations
();
String
paramName
=
constraintViolations
.
iterator
().
next
().
getPropertyPath
().
toString
();
String
paramError
=
constraintViolations
.
iterator
().
next
().
getMessage
();
return
getRestResponse
(
com
.
gic
.
enterprise
.
error
.
ErrorCode
.
ERR_5
.
getCode
(),
getFailFastMsg
(
paramName
,
paramError
));
return
getRestResponse
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
getFailFastMsg
(
paramName
,
paramError
));
}
/**
...
...
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