You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "heyihong (via GitHub)" <gi...@apache.org> on 2026/02/05 12:47:44 UTC

Re: [PR] [SPARK-55275] SQL State Coverage: IllegalStateException [spark]

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


##########
sql/connect/server/src/main/scala/org/apache/spark/sql/connect/execution/ExecuteResponseObserver.scala:
##########
@@ -133,7 +133,9 @@ private[connect] class ExecuteResponseObserver[T <: Message](val executeHolder:
 
   def onNext(r: T): Unit = {
     if (!tryOnNext(r)) {
-      throw new IllegalStateException("Stream onNext can't be called after stream completed")
+      throw new SparkIllegalStateException(

Review Comment:
   Could you centralize the construction of SparkIllegalStateException into a class like SparkIllegalStateErrors (here is [an example](https://github.com/apache/spark/blob/master/sql/connect/server/src/main/scala/org/apache/spark/sql/connect/planner/InvalidInputErrors.scala)) to reduce code duplication and improve reuse? 



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