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 2021/05/20 08:22:45 UTC

[GitHub] [spark] maropu commented on a change in pull request #32600: [SPARK-35456][CORE] Print the invalid value in config validation error message

maropu commented on a change in pull request #32600:
URL: https://github.com/apache/spark/pull/32600#discussion_r635882306



##########
File path: core/src/main/scala/org/apache/spark/internal/config/ConfigBuilder.scala
##########
@@ -104,7 +104,7 @@ private[spark] class TypedConfigBuilder[T](
   /** Checks if the user-provided value for the config matches the validator. */
   def checkValue(validator: T => Boolean, errorMsg: String): TypedConfigBuilder[T] = {
     transform { v =>
-      if (!validator(v)) throw new IllegalArgumentException(errorMsg)
+      if (!validator(v)) throw new IllegalArgumentException(s"'$v' is invalid. $errorMsg")

Review comment:
       This looks clearer. btw, nit: how about `s"'$v' is invalid because: $errorMsg"`




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

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