karenfeng commented on a change in pull request #33164:
URL: https://github.com/apache/spark/pull/33164#discussion_r665598729



##########
File path: core/src/main/scala/org/apache/spark/SparkException.scala
##########
@@ -69,12 +73,11 @@ private[spark] class SparkUpgradeException(version: String, 
message: String, cau
 /**
  * Arithmetic exception thrown from Spark with an error class.
  */
-class SparkArithmeticException(
-    val errorClass: Option[String],
-    val messageParameters: Seq[String])
-  extends ArithmeticException(SparkError.getMessage(errorClass.get, 
messageParameters))
-    with SparkError {
+class SparkArithmeticException(errorClass: String, messageParameters: 
Array[String])
+  extends ArithmeticException(SparkThrowableHelper.getMessage(errorClass, 
messageParameters))
+    with SparkThrowable {
 
-  def this(errorClass: String, messageParameters: Seq[String]) =
-    this(errorClass = Some(errorClass), messageParameters = messageParameters)
+  override def getErrorClass: String = errorClass
+  override def getMessageParameters: Array[String] = messageParameters

Review comment:
       Good call - this was in order to construct a `ParseException` from an 
`AnalysisException`, but I was able to work around this by making 
`messageParameters` accessible as a `val`.

##########
File path: core/src/main/resources/error/README.md
##########
@@ -1,27 +1,24 @@
 # Guidelines
 
-To throw a standardized user-facing exception, developers should specify the 
error class and
-message parameters rather than an arbitrary error message.
+To throw a standardized user-facing error of exception, developers should 
specify the error class

Review comment:
       Whoops, fixed!




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