fix message null

This commit is contained in:
tianliyong 2023-08-17 17:37:04 +08:00
parent c63f3104b7
commit 8717552121

View File

@ -6,6 +6,7 @@ import cn.axzo.framework.domain.web.result.ApiResult;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.val;
import org.apache.commons.lang3.StringUtils;
import org.springframework.boot.autoconfigure.web.ErrorProperties;
import org.springframework.boot.autoconfigure.web.ErrorProperties.IncludeStacktrace;
import org.springframework.boot.autoconfigure.web.ServerProperties;
@ -103,7 +104,7 @@ public class GlobalErrorController extends AbstractErrorController {
Object trace = data.get("trace");
if (trace != null && status.is5xxServerError()) {
return trace.toString();
} else if (!Objects.equals(message, "No errors") && !Objects.equals(message, "No message available")) {
} else if (StringUtils.isNotBlank(message + "") && !Objects.equals(message, "No errors") && !Objects.equals(message, "No message available")) {
if (cause.getDepth() > 0) {
return cause.getError().getMessage();
}