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 ConnectIllegalStateErrors (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?
##########
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 IllegalStateErrors (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: [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]