heyihong commented on code in PR #44581:
URL: https://github.com/apache/spark/pull/44581#discussion_r1441699158


##########
connector/connect/common/src/main/scala/org/apache/spark/sql/connect/client/GrpcExceptionConverter.scala:
##########
@@ -380,9 +388,19 @@ private[client] object GrpcExceptionConverter {
    *   with a single entry where the key is "message" and the value is the 
message from the
    *   params.
    */
-  private def errorParamsToMessageParameters(params: ErrorParams): Map[String, 
String] =
-    params.errorClass match {
-      case Some(_) => params.messageParameters
-      case None => Map("message" -> params.message)
+  private def errorParamsToMessageParameters(params: ErrorParams): Map[String, 
String] = {
+    if (isValidErrorClass(params.errorClass)) {
+      params.messageParameters
+    } else {
+      Map("message" -> Option(params.message).getOrElse("No message"))

Review Comment:
   params.message is not null.
   ```
    Map("message" -> params.message)
   ```
   should be sufficient



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to