You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/05/27 05:48:35 UTC

[GitHub] [spark] bozhang2820 commented on a diff in pull request #36695: [SPARK-38474] [Core] Use error class in org.apache.spark.security

bozhang2820 commented on code in PR #36695:
URL: https://github.com/apache/spark/pull/36695#discussion_r883293864


##########
core/src/main/scala/org/apache/spark/security/SocketAuthHelper.scala:
##########
@@ -60,7 +61,7 @@ private[spark] class SocketAuthHelper(val conf: SparkConf) {
           shouldClose = false
         } else {
           writeUtf8("err", s)
-          throw new IllegalArgumentException("Authentication failed.")
+          throw SparkCoreErrors.authenticationFailedError("client")

Review Comment:
   Not sure if we should change the exception type here. CC @MaxGekk for more guidance. 



##########
core/src/main/scala/org/apache/spark/errors/SparkCoreErrors.scala:
##########
@@ -325,4 +325,13 @@ object SparkCoreErrors {
     new SparkException(errorClass = "GRAPHITE_SINK_PROPERTY_MISSING",
       messageParameters = Array(missingProperty), cause = null)
   }
+
+  def authenticationFailedError(hostType: String): Throwable = {
+    new SparkException(errorClass = "AUTHENTICATION_FAILED",
+      messageParameters = Array(hostType), cause = null)
+  }
+
+  def streamClosed(): Throwable = {
+    new SparkException("Cipher stream is closed.")
+  }

Review Comment:
   Let's create one for this in error-classes.json as well.



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