异常打印
This commit is contained in:
@@ -29,8 +29,8 @@ spring:
|
|||||||
dubbo:
|
dubbo:
|
||||||
application:
|
application:
|
||||||
name: order-server
|
name: order-server
|
||||||
qos-port: 22231
|
# qos-port: 22231
|
||||||
qos-enable: true
|
qos-enable: false
|
||||||
registry:
|
registry:
|
||||||
address: nacos://121.40.109.122:8848 # Nacos 服务地址
|
address: nacos://121.40.109.122:8848 # Nacos 服务地址
|
||||||
group: server-dev
|
group: server-dev
|
||||||
|
|||||||
@@ -30,8 +30,10 @@ spring:
|
|||||||
dubbo:
|
dubbo:
|
||||||
application:
|
application:
|
||||||
name: order-server
|
name: order-server
|
||||||
qos-port: 22232
|
# qos-port: 22232
|
||||||
qos-enable: true
|
qos-enable: false
|
||||||
|
logger: log4j2
|
||||||
|
environment: test
|
||||||
registry:
|
registry:
|
||||||
address: nacos://121.40.109.122:8848 # Nacos 服务地址
|
address: nacos://121.40.109.122:8848 # Nacos 服务地址
|
||||||
group: server-test
|
group: server-test
|
||||||
|
|||||||
@@ -35,7 +35,6 @@ public class CzgControllerAdvice {
|
|||||||
@ResponseStatus(HttpStatus.OK)
|
@ResponseStatus(HttpStatus.OK)
|
||||||
public CzgResult<Object> errorHandler(Exception ex) {
|
public CzgResult<Object> errorHandler(Exception ex) {
|
||||||
setErrorLog(ex);
|
setErrorLog(ex);
|
||||||
log.error("", ex);
|
|
||||||
return CzgResult.failure(CzgRespCode.SYSTEM_ERROR.getCode(), ex.getMessage());
|
return CzgResult.failure(CzgRespCode.SYSTEM_ERROR.getCode(), ex.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -99,6 +98,7 @@ public class CzgControllerAdvice {
|
|||||||
*/
|
*/
|
||||||
@ExceptionHandler(CzgException.class)
|
@ExceptionHandler(CzgException.class)
|
||||||
public CzgResult<Object> handleCzgException(CzgException ex) {
|
public CzgResult<Object> handleCzgException(CzgException ex) {
|
||||||
|
setErrorLog(ex);
|
||||||
return CzgResult.failure(ex.getCode(), ex.getMsg());
|
return CzgResult.failure(ex.getCode(), ex.getMsg());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -124,6 +124,7 @@ public class CzgControllerAdvice {
|
|||||||
*/
|
*/
|
||||||
@ExceptionHandler(ValidateException.class)
|
@ExceptionHandler(ValidateException.class)
|
||||||
public CzgResult<Object> handleValidateException(ValidateException ex) {
|
public CzgResult<Object> handleValidateException(ValidateException ex) {
|
||||||
|
setErrorLog(ex);
|
||||||
return CzgResult.failure(CzgRespCode.PARAM_ERROR.getCode(), ex.getMessage());
|
return CzgResult.failure(CzgRespCode.PARAM_ERROR.getCode(), ex.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user