spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From JoshRosen <...@git.apache.org>
Subject [GitHub] spark pull request: [SPARK-4379][Core] Change Exception to SparkEx...
Date Thu, 13 Nov 2014 21:40:27 GMT
Github user JoshRosen commented on the pull request:

    https://github.com/apache/spark/pull/3241#issuecomment-62971082
  
    We're throwing a more specific exception class, so I guess that caller code doesn't need
to change: if the old caller code caught `Exception` then it can certainly catch `SparkException`
since that's a subclass.  Things would be different if we changed this to throw a wider exception
type.
    
    I think this compatibility concern is moot, though, since `checkpoint()` wasn't declared
with the `@throws` Scala annotation, so the generated code method won't have any declared
exceptions:
    
    ```scala
    scala> import java.io.IOException
    import java.io.IOException
    
    scala> class A {
         |   def foo() {
         |    throw new IOException("error!")
         |   }
         | }
    defined class A
    
    scala> :javap -s A
    Compiled from "<console>"
    public class A {
      public void foo();
        Signature: ()V
    
      public A();
        Signature: ()V
    }
    
    scala> class B {
         |   @throws[IOException]
         |   def foo() {
         |      throw new IOException("error!")
         |   }
         | }
    defined class B
    
    scala> :javap -s B
    Compiled from "<console>"
    public class B {
      public void foo() throws java.io.IOException;
        Signature: ()V
    
      public B();
        Signature: ()V
    }
    ```


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