Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Fedex
/
iClear-Connect-Pre-Clearance
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
tao.mo
2025-04-01 18:44:43 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
76bec11a2a09e67045928f4307fee73f48e90fd5
76bec11a
1 parent
0dc44e21
common-dependencies | 修改 |
日志输出调整 mt 2025年4月1日18:44:30
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
server/common-dependencies/src/main/java/com/fedex/connect/common/dependencies/config/ControllerExceptionAdvice.java
server/common-dependencies/src/main/java/com/fedex/connect/common/dependencies/config/ControllerExceptionAdvice.java
View file @
76bec11
...
...
@@ -3,16 +3,19 @@ package com.fedex.connect.common.dependencies.config;
import
com.fedex.connect.common.dependencies.date.vo.ResponseVo
;
import
com.fedex.connect.common.dependencies.exception.BaseException
;
import
com.fedex.connect.common.dependencies.exception.OpErrorException
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
;
import
org.springframework.web.bind.annotation.ExceptionHandler
;
import
org.springframework.web.bind.annotation.RestControllerAdvice
;
@Slf4j
@ConditionalOnProperty
(
prefix
=
"common.exception-advice-webconfig"
,
name
=
"enable"
,
havingValue
=
"true"
)
@RestControllerAdvice
public
class
ControllerExceptionAdvice
{
@ExceptionHandler
(
Exception
.
class
)
public
ResponseVo
exceptionHandler
(
Exception
ex
)
{
log
.
error
(
ex
.
getMessage
(),
ex
);
ResponseVo
res
=
new
ResponseVo
();
res
.
setSuccess
(
false
);
res
.
setCode
(
599
);
...
...
@@ -22,6 +25,7 @@ public class ControllerExceptionAdvice {
@ExceptionHandler
(
BaseException
.
class
)
public
ResponseVo
baseExceptionHandler
(
BaseException
ex
)
{
log
.
error
(
ex
.
getMessage
(),
ex
);
ResponseVo
res
=
new
ResponseVo
();
res
.
setSuccess
(
false
);
res
.
setCode
(
ex
.
getCode
().
intValue
());
...
...
@@ -31,6 +35,7 @@ public class ControllerExceptionAdvice {
@ExceptionHandler
(
OpErrorException
.
class
)
public
ResponseVo
opErrorExceptionHandler
(
OpErrorException
ex
)
{
log
.
error
(
ex
.
getMessage
(),
ex
);
ResponseVo
res
=
new
ResponseVo
();
res
.
setSuccess
(
false
);
res
.
setCode
(
ex
.
getCode
());
...
...
Please
register
or
login
to post a comment