异常打印8

This commit is contained in:
wangw 2025-11-12 11:42:21 +08:00
parent 351d54579e
commit f45da91a6d
1 changed files with 2 additions and 2 deletions

View File

@ -145,7 +145,7 @@ public class CzgControllerAdvice {
@ResponseStatus(HttpStatus.OK)
public CzgResult<Object> errorHandler(Exception ex) {
Throwable rootCause = ex;
log.info("rootCause2:{}", rootCause);
log.info("rootCause2:{}", rootCause.getClass());
// 处理自定义异常
if (rootCause instanceof CzgException czgException) {
return CzgResult.failure(czgException.getCode(), czgException.getMessage());
@ -160,7 +160,7 @@ public class CzgControllerAdvice {
return CzgResult.success("支付成功");
}
while (rootCause.getCause() != null) {
log.info("rootCause1:{}", rootCause);
log.info("rootCause1:{}", rootCause.getClass());
rootCause = rootCause.getCause();
if (rootCause instanceof CzgException czgException) {
return CzgResult.failure(czgException.getCode(), czgException.getMessage());