You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "MaxGekk (via GitHub)" <gi...@apache.org> on 2024/01/18 08:05:15 UTC

Re: [PR] [SPARK-46708] Support message format in connect [spark]

MaxGekk commented on code in PR #44714:
URL: https://github.com/apache/spark/pull/44714#discussion_r1457064057


##########
connector/connect/server/src/main/scala/org/apache/spark/sql/connect/service/SparkConnectService.scala:
##########
@@ -376,8 +376,13 @@ object SparkConnectService extends Logging {
     uiTab.foreach(_.detach())
   }
 
-  def extractErrorMessage(st: Throwable): String = {
-    val message = StringUtils.abbreviate(st.getMessage, 2048)
+  def extractErrorMessage(st: Throwable, format: ErrorMessageFormat.Value): String = {
+    val message = st match {
+      case e: SparkThrowable =>
+        SparkThrowableHelper.getMessage(e, format)

Review Comment:
   Should we restrict the message size by 2048 as well? Some error formats might include full stack traces, and you can face to some resource restrictions like message, buffer sizes while building proto back.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org