You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "Hisoka-X (via GitHub)" <gi...@apache.org> on 2023/04/14 03:40:44 UTC

[GitHub] [spark] Hisoka-X commented on a diff in pull request #40780: [SPARK-43125][CONNECT] Fix Connect Server Can't Handle Exception With Null Message

Hisoka-X commented on code in PR #40780:
URL: https://github.com/apache/spark/pull/40780#discussion_r1166247433


##########
connector/connect/server/src/main/scala/org/apache/spark/sql/connect/service/SparkConnectService.scala:
##########
@@ -85,7 +86,7 @@ class SparkConnectService(debug: Boolean)
             .setDomain("org.apache.spark")
             .putMetadata("classes", compact(render(allClasses(st.getClass).map(_.getName))))
             .build()))
-      .setMessage(StringUtils.abbreviate(st.getMessage, 2048))
+      .setMessage(if (message != null) message else "")

Review Comment:
   > I am wondering when message could be null than an empty string?
   
   `NullPointerException`
   
   > If this is a valid case we can use st: Optiona[Throwable] instead?
   
   Can't, like NPE, the `Optiona[Throwable]` would not empty, but message in NPT still `null`.



-- 
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