diff --git a/seatunnel-server/seatunnel-app/src/main/java/org/apache/seatunnel/app/common/SeatunnelErrorEnum.java b/seatunnel-server/seatunnel-app/src/main/java/org/apache/seatunnel/app/common/SeatunnelErrorEnum.java index 3f770b7256b..5e54ef5fac7 100644 --- a/seatunnel-server/seatunnel-app/src/main/java/org/apache/seatunnel/app/common/SeatunnelErrorEnum.java +++ b/seatunnel-server/seatunnel-app/src/main/java/org/apache/seatunnel/app/common/SeatunnelErrorEnum.java @@ -24,7 +24,7 @@ public enum SeatunnelErrorEnum { USER_ALREADY_EXISTS(10003, "user already exist", "The same username [%s] is exist."), NO_SUCH_USER(10002, "no such user", "No such user. Maybe deleted by others."), ILLEGAL_STATE(99998, "illegal state", "%s"), - UNKNOWN(99999, "unknown exception", "unknown exception") + UNKNOWN(99999, "unknown exception", "%s") ; private final int code; diff --git a/seatunnel-server/seatunnel-app/src/main/java/org/apache/seatunnel/app/util/GlobalExceptionHandler.java b/seatunnel-server/seatunnel-app/src/main/java/org/apache/seatunnel/app/util/GlobalExceptionHandler.java index 3b3678c30f3..511dbe5976e 100644 --- a/seatunnel-server/seatunnel-app/src/main/java/org/apache/seatunnel/app/util/GlobalExceptionHandler.java +++ b/seatunnel-server/seatunnel-app/src/main/java/org/apache/seatunnel/app/util/GlobalExceptionHandler.java @@ -52,11 +52,11 @@ private Result exceptionHandler(IllegalStateException e) { @ExceptionHandler(value = Exception.class) private Result exceptionHandler(Exception e) { logError(e); - return Result.failure(SeatunnelErrorEnum.UNKNOWN); + return Result.failure(SeatunnelErrorEnum.UNKNOWN, e.getMessage()); } private void logError(Throwable throwable) { - log.error("", throwable); + log.error(throwable.getMessage(), throwable); } }