title: Java: Catching lambda exceptions
body: <p>Not able to wrap stream object in a <code>try/catch block</code>.</p>
  
  <p>I tried like this:</p>
  
  <pre><code>reponseNodes.stream().parallel().collect(Collectors.toMap(responseNode -&gt; responseNode.getLabel(), responseNode -&gt; processImage(responseNode)));
  </code></pre>
  
  <p>Eclipse started complaining  underlining <code>processImage(responseNode)</code> and suggested that it needs to <code>Surround with try/catch</code>.</p>
  
  <p>Then I updated to:</p>
  
  <pre><code>return reponseNodes.stream().parallel().collect(Collectors.toMap(responseNode -&gt; responseNode.getLabel(), responseNode -&gt; try { processImage(responseNode) } catch (Exception e) { throw new UncheckedException(e); }));
  </code></pre>
  
  <p>Updated code also did not work.</p>