From 88dc109388e90fdf110aa396bb8194b733d66505 Mon Sep 17 00:00:00 2001 From: taojinlong Date: Wed, 26 Feb 2025 16:00:41 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=A3=9E=E4=B9=A6=E5=85=B3=E9=97=AD?= =?UTF-8?q?=E7=8A=B6=E6=80=81=EF=BC=8C=E6=95=B0=E6=8D=AE=E6=BA=90=E4=B8=8D?= =?UTF-8?q?=E5=8F=AF=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datasource/server/DatasourceServer.java | 19 +++++++++++++++---- .../datasource/form/ApiHttpRequestDraw.vue | 3 +-- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/core/core-backend/src/main/java/io/dataease/datasource/server/DatasourceServer.java b/core/core-backend/src/main/java/io/dataease/datasource/server/DatasourceServer.java index 72b254fa36..919e59f042 100644 --- a/core/core-backend/src/main/java/io/dataease/datasource/server/DatasourceServer.java +++ b/core/core-backend/src/main/java/io/dataease/datasource/server/DatasourceServer.java @@ -1323,11 +1323,22 @@ public class DatasourceServer implements DatasourceApi { } resObj = method.invoke(null, object); } catch (Exception e) { - if (e.getCause() != null && e.getCause() instanceof DEException) { - DEException.throwException(e.getCause().getMessage()); - } - DEException.throwException(e); + DEException.throwException(msg(e)); } return resObj; } + + private String msg(Throwable e) { + Throwable exception = e; + while (true) { + if (exception.getCause() == null) { + return exception.getMessage(); + } + if (exception instanceof DEException && !(exception.getCause() instanceof DEException)) { + return exception.getMessage(); + } + exception = exception.getCause(); + + } + } } diff --git a/core/core-frontend/src/views/visualized/data/datasource/form/ApiHttpRequestDraw.vue b/core/core-frontend/src/views/visualized/data/datasource/form/ApiHttpRequestDraw.vue index 6ae4175579..fc271e6b1a 100644 --- a/core/core-frontend/src/views/visualized/data/datasource/form/ApiHttpRequestDraw.vue +++ b/core/core-frontend/src/views/visualized/data/datasource/form/ApiHttpRequestDraw.vue @@ -829,6 +829,7 @@ defineExpose({ > - -