From 9f8559b048422c6961807010a58bfe5189792ed9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=BA=E7=94=9F=E6=9C=89=E5=A6=82=E4=B8=A4=E4=B8=AA?= =?UTF-8?q?=E6=A9=98=E5=AD=90?= <15764973965@163.com> Date: Wed, 2 Aug 2023 10:28:25 +0800 Subject: [PATCH] [optimize] return to the custom error info (#4835) * [optimize] return to the custom error info * format --- .../engineplugin/python/executor/PythonSession.scala | 6 ++++-- .../engineplugin/spark/executor/SparkPythonExecutor.scala | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/linkis-engineconn-plugins/python/src/main/scala/org/apache/linkis/manager/engineplugin/python/executor/PythonSession.scala b/linkis-engineconn-plugins/python/src/main/scala/org/apache/linkis/manager/engineplugin/python/executor/PythonSession.scala index 186ba96341..b17c035587 100644 --- a/linkis-engineconn-plugins/python/src/main/scala/org/apache/linkis/manager/engineplugin/python/executor/PythonSession.scala +++ b/linkis-engineconn-plugins/python/src/main/scala/org/apache/linkis/manager/engineplugin/python/executor/PythonSession.scala @@ -169,9 +169,11 @@ class PythonSession extends Logging { if (process == null) { Utils.tryThrow(initGateway) { t => { - logger.error("initialize python executor failed, please ask administrator for help!", t) + val errMsg = + s"initialize python executor failed, please ask administrator for help! errMsg: ${t.getMessage}" + logger.error(errMsg, t) Utils.tryAndWarn(close) - throw t + throw new IllegalStateException(errMsg, t) } } } diff --git a/linkis-engineconn-plugins/spark/src/main/scala/org/apache/linkis/engineplugin/spark/executor/SparkPythonExecutor.scala b/linkis-engineconn-plugins/spark/src/main/scala/org/apache/linkis/engineplugin/spark/executor/SparkPythonExecutor.scala index c3eb869b92..a47a0b395a 100644 --- a/linkis-engineconn-plugins/spark/src/main/scala/org/apache/linkis/engineplugin/spark/executor/SparkPythonExecutor.scala +++ b/linkis-engineconn-plugins/spark/src/main/scala/org/apache/linkis/engineplugin/spark/executor/SparkPythonExecutor.scala @@ -289,9 +289,11 @@ class SparkPythonExecutor(val sparkEngineSession: SparkEngineSession, val id: In if (process == null) { Utils.tryThrow(initGateway) { t => { - logger.error("initialize python executor failed, please ask administrator for help!", t) + val errMsg = + s"initialize python executor failed, please ask administrator for help! errMsg: ${t.getMessage}" + logger.error(errMsg, t) Utils.tryAndWarn(close) - throw t + throw new IllegalStateException(errMsg, t) } } }