zhenlineo commented on code in PR #39947: URL: https://github.com/apache/spark/pull/39947#discussion_r1145575350
########## connector/connect/server/src/main/scala/org/apache/spark/sql/connect/service/SparkConnectService.scala: ########## @@ -53,19 +59,37 @@ class SparkConnectService(debug: Boolean) extends SparkConnectServiceGrpc.SparkConnectServiceImplBase with Logging { - private def buildStatusFromThrowable[A <: Throwable with SparkThrowable](st: A): RPCStatus = { - val t = Option(st.getCause).getOrElse(st) + private def allClasses(cl: Class[_]): Seq[Class[_]] = { + val classes = ArrayBuffer.empty[Class[_]] + if (cl != null && cl != classOf[java.lang.Object]) { + classes.append(cl) // Includes itself. + } + + @tailrec + def appendSuperClasses(clazz: Class[_]): Unit = { + if (clazz == null || clazz == classOf[java.lang.Object]) return + classes.append(clazz.getSuperclass) + appendSuperClasses(clazz.getSuperclass) + } + + appendSuperClasses(cl) + classes + } + + private def buildStatusFromThrowable(st: Throwable): RPCStatus = { RPCStatus .newBuilder() .setCode(RPCCode.INTERNAL_VALUE) .addDetails( ProtoAny.pack( ErrorInfo .newBuilder() - .setReason(t.getClass.getName) + .setReason(st.getClass.getName) .setDomain("org.apache.spark") + .putMetadata("message", StringUtils.abbreviate(st.getMessage, 2048)) Review Comment: @HyukjinKwon Am I understand correctly the header limit is for the HTTP header? Can we put it in the body? Is there still a ~4K limit? -- 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-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org