异常打印8
This commit is contained in:
parent
351d54579e
commit
f45da91a6d
|
|
@ -145,7 +145,7 @@ public class CzgControllerAdvice {
|
||||||
@ResponseStatus(HttpStatus.OK)
|
@ResponseStatus(HttpStatus.OK)
|
||||||
public CzgResult<Object> errorHandler(Exception ex) {
|
public CzgResult<Object> errorHandler(Exception ex) {
|
||||||
Throwable rootCause = ex;
|
Throwable rootCause = ex;
|
||||||
log.info("rootCause2:{}", rootCause);
|
log.info("rootCause2:{}", rootCause.getClass());
|
||||||
// 处理自定义异常
|
// 处理自定义异常
|
||||||
if (rootCause instanceof CzgException czgException) {
|
if (rootCause instanceof CzgException czgException) {
|
||||||
return CzgResult.failure(czgException.getCode(), czgException.getMessage());
|
return CzgResult.failure(czgException.getCode(), czgException.getMessage());
|
||||||
|
|
@ -160,7 +160,7 @@ public class CzgControllerAdvice {
|
||||||
return CzgResult.success("支付成功");
|
return CzgResult.success("支付成功");
|
||||||
}
|
}
|
||||||
while (rootCause.getCause() != null) {
|
while (rootCause.getCause() != null) {
|
||||||
log.info("rootCause1:{}", rootCause);
|
log.info("rootCause1:{}", rootCause.getClass());
|
||||||
rootCause = rootCause.getCause();
|
rootCause = rootCause.getCause();
|
||||||
if (rootCause instanceof CzgException czgException) {
|
if (rootCause instanceof CzgException czgException) {
|
||||||
return CzgResult.failure(czgException.getCode(), czgException.getMessage());
|
return CzgResult.failure(czgException.getCode(), czgException.getMessage());
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue