title: Aggregate runtime exceptions in Java 8 streams
body: <p>Let's say I have a method which throws a runtime exception. I'm using a <code>Stream</code> to call this method on items in a list.</p>
  
  <pre><code>class ABC {
  
      public void doStuff(MyObject myObj) {
          if (...) {
              throw new IllegalStateException("Fire! Fear! Foes! Awake!");
          }
          // do stuff...
      }
  
      public void doStuffOnList(List&lt;MyObject&gt; myObjs) {
          try {
              myObjs.stream().forEach(ABC:doStuff);
          } catch(AggregateRuntimeException??? are) {
              ...
          }             
      }
  }
  </code></pre>
  
  <p>Now I want all items in the list to be processed, and any runtime exceptions on individual items to be collected into an "aggregate" runtime exception which will be thrown at the end.</p>
  
  <p>In my real code, I am making 3rd party API calls which may throw runtime exceptions. I want to make sure that all items are processed and any errors reported at the end.</p>
  
  <p>I can think of a few ways to hack this out, such as a <code>map()</code> function which catches and returns the exception (<em>..shudder..</em>). But is there a native way to do this? If not, is there another way to implement it cleanly?</p>