异常打印4

This commit is contained in:
wangw 2025-11-12 11:28:13 +08:00
parent 0428a4a202
commit 5141c019cd
1 changed files with 1 additions and 0 deletions

View File

@ -146,6 +146,7 @@ public class CzgControllerAdvice {
public CzgResult<Object> errorHandler(Exception ex) { public CzgResult<Object> errorHandler(Exception ex) {
Throwable rootCause = ex; Throwable rootCause = ex;
while (rootCause.getCause() != null) { while (rootCause.getCause() != null) {
log.info("rootCause:{}", 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());