You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@linkis.apache.org by pe...@apache.org on 2022/04/07 14:35:20 UTC

[incubator-linkis] branch dev-1.1.2 updated: expose ec plugin exception detail (#1903)

This is an automated email from the ASF dual-hosted git repository.

peacewong pushed a commit to branch dev-1.1.2
in repository https://gitbox.apache.org/repos/asf/incubator-linkis.git


The following commit(s) were added to refs/heads/dev-1.1.2 by this push:
     new 577122154 expose ec plugin exception detail (#1903)
577122154 is described below

commit 577122154264d84cab25f8b8b98a3d9189a84577
Author: legendtkl <ta...@gmail.com>
AuthorDate: Thu Apr 7 22:35:14 2022 +0800

    expose ec plugin exception detail (#1903)
    
    * expose ec plugin exception detail
    
    * update
---
 .../org/apache/linkis/rpc/message/method/MessageExecutor.java | 11 ++++++++++-
 .../manager/am/pointer/DefaultEngineConnPluginPointer.scala   |  2 ++
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/linkis-commons/linkis-rpc/src/main/java/org/apache/linkis/rpc/message/method/MessageExecutor.java b/linkis-commons/linkis-rpc/src/main/java/org/apache/linkis/rpc/message/method/MessageExecutor.java
index 9b8a90ee1..68a105ce1 100644
--- a/linkis-commons/linkis-rpc/src/main/java/org/apache/linkis/rpc/message/method/MessageExecutor.java
+++ b/linkis-commons/linkis-rpc/src/main/java/org/apache/linkis/rpc/message/method/MessageExecutor.java
@@ -24,6 +24,7 @@ import org.apache.linkis.rpc.message.exception.MessageErrorException;
 import org.apache.linkis.rpc.message.exception.MessageWarnException;
 import org.apache.linkis.rpc.message.utils.MessageUtils;
 
+import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.util.ArrayList;
 import java.util.List;
@@ -87,7 +88,15 @@ public class MessageExecutor extends JavaLog {
                 }
             } catch (Throwable t) {
                 logger().error(String.format("method %s call failed", methodWrapper.getAlias()), t);
-                throw new MessageWarnException(10000, "method call failed", t);
+
+                final String errorMsg =
+                        t instanceof InvocationTargetException
+                                ? "method call failed: "
+                                        + ((InvocationTargetException) t)
+                                                .getTargetException()
+                                                .getMessage()
+                                : "method call failed.";
+                throw new MessageWarnException(10000, errorMsg, t);
             }
         }
         return result;
diff --git a/linkis-computation-governance/linkis-manager/linkis-application-manager/src/main/scala/org/apache/linkis/manager/am/pointer/DefaultEngineConnPluginPointer.scala b/linkis-computation-governance/linkis-manager/linkis-application-manager/src/main/scala/org/apache/linkis/manager/am/pointer/DefaultEngineConnPluginPointer.scala
index a3c0682eb..29b3cc30c 100644
--- a/linkis-computation-governance/linkis-manager/linkis-application-manager/src/main/scala/org/apache/linkis/manager/am/pointer/DefaultEngineConnPluginPointer.scala
+++ b/linkis-computation-governance/linkis-manager/linkis-application-manager/src/main/scala/org/apache/linkis/manager/am/pointer/DefaultEngineConnPluginPointer.scala
@@ -35,6 +35,8 @@ class DefaultEngineConnPluginPointer extends EngineConnPluginPointer {
     getEngineConnPluginSender.ask(engineResourceRequest) match {
       case nodeResource: NodeResource =>
         nodeResource
+      case ecpTaskException: Exception =>
+        throw new AMErrorException(AMConstant.ENGINE_ERROR_CODE, ecpTaskException.getMessage, ecpTaskException)
       case _ =>
         throw new AMErrorException(AMConstant.ENGINE_ERROR_CODE, s"Failed to create engineResource")
     }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@linkis.apache.org
For additional commands, e-mail: commits-help@linkis.apache.org