cloud-fan commented on code in PR #36693: URL: https://github.com/apache/spark/pull/36693#discussion_r892541582
########## core/src/main/scala/org/apache/spark/SparkException.scala: ########## @@ -73,236 +101,340 @@ private[spark] case class ExecutorDeadException(message: String) */ private[spark] class SparkUpgradeException( errorClass: String, + errorSubClass: Option[String] = None, messageParameters: Array[String], cause: Throwable) - extends RuntimeException(SparkThrowableHelper.getMessage(errorClass, messageParameters), cause) + extends RuntimeException(SparkThrowableHelper.getMessage(errorClass, errorSubClass, + messageParameters), cause) with SparkThrowable { + override def getMessageParameters: Array[String] = messageParameters override def getErrorClass: String = errorClass -} + override def getErrorSubClass: String = errorSubClass.orNull} /** * Arithmetic exception thrown from Spark with an error class. */ private[spark] class SparkArithmeticException( errorClass: String, + errorSubClass: Option[String] = None, messageParameters: Array[String], queryContext: String = "") extends ArithmeticException( - SparkThrowableHelper.getMessage(errorClass, messageParameters, queryContext)) + SparkThrowableHelper.getMessage(errorClass, errorSubClass, messageParameters, queryContext)) with SparkThrowable { + override def getMessageParameters: Array[String] = messageParameters override def getErrorClass: String = errorClass -} + override def getErrorSubClass: String = errorSubClass.orNull} /** * Unsupported operation exception thrown from Spark with an error class. */ private[spark] class SparkUnsupportedOperationException( errorClass: String, + errorSubClass: Option[String] = None, messageParameters: Array[String]) extends UnsupportedOperationException( - SparkThrowableHelper.getMessage(errorClass, messageParameters)) with SparkThrowable { + SparkThrowableHelper.getMessage(errorClass, errorSubClass, messageParameters)) + with SparkThrowable { + def this( + errorClass: String, + errorSubClass: String, + messageParameters: Array[String]) = Review Comment: ```suggestion def this( errorClass: String, errorSubClass: String, messageParameters: Array[String]) = ``` -- 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