title: propagating Exception from inside of a forEach loop
body: <pre><code>public controllerMethod() throws UnsupportedEncodingException {
    getVehicles(req);
  }
  
  public List&lt;vehicles&gt; getVehicles(A req) throws UnsupportedEncodingException{
     someObject.forEach(obj -&gt; {  
        getVehicles2(req); //try catch resolves but why wouldn't throws handle this ? 
     }
  }
  
  public getVehicles2(A req) throws UnsupportedEncodingException{
  
  }
  </code></pre>
  
  <p>I am trying to call getVehicles2() from getVehicles. The compiler complains that there is an unhandled Exception in doing so. Wouldn't declaring the exception  with throws is not sufficient to propagate it upto the parent controller method. Try/catch would resolve the error, but I thought declaring throws would propagate relating errors to calling method.</p>