spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From joan38 <...@git.apache.org>
Subject [GitHub] spark pull request: [SPARK-13815][MLlib] Provide better Exception ...
Date Wed, 16 Mar 2016 21:52:55 GMT
Github user joan38 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/11772#discussion_r56422387
  
    --- Diff: mllib/src/main/scala/org/apache/spark/ml/util/ReadWrite.scala ---
    @@ -282,7 +282,10 @@ private[ml] object DefaultParamsReader {
        */
       def loadMetadata(path: String, sc: SparkContext, expectedClassName: String = ""): Metadata
= {
         val metadataPath = new Path(path, "metadata").toString
    -    val metadataStr = sc.textFile(metadataPath, 1).first()
    +    val metadataStr = try sc.textFile(metadataPath, 1).first() catch {
    +      case _: UnsupportedOperationException =>
    +        throw new IllegalArgumentException(s"Empty metadata for path $path")
    --- End diff --
    
    Let me know if you have any better error message.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Mime
View raw message