title: Java 8 method reference unhandled exception
body: <p>I'm working on project with Java 8 and found one situation which I can't understand.</p>
  
  <p>I have code like this:</p>
  
  <pre><code>void deleteEntity(Node node) throws SomeException {
      for (ChildNode child: node.getChildren()) {
         deleteChild(child);
      }
  }
  
  void deleteChild(Object child) throws SomeException {
      //some code
  }
  </code></pre>
  
  <p>This code is working fine, but I can rewrite it with a method reference:</p>
  
  <pre><code>void deleteEntity(Node node) throws SomeException {
      node.getChildren().forEach(this::deleteChild);
  }
  </code></pre>
  
  <p>And this code doesn't compile,  giving the error <code>Incompatible thrown types *SomeException* in method reference</code>.</p>
  
  <p>Also IDEA gave me the error <code>unhandled exception</code>.</p>
  
  <p>So, my question is why? Why code compiles with for each loop and doesn't compile with lambda?</p>