title: exception handling in executor service
body: <p>When I throw exception from student name archana.
  As per my understanding <strong>InvokeAll</strong> waits for all task to be completed and then return future list</p>
  
  <p>Output I get is</p>
  
  <pre><code> pool-1-thread-1 Helloprerna   
   pool-1-thread-2 Helloabc   
   HELLO SOMEERROR   
   Execution Completed
  </code></pre>
  
  <p>I want other tasks output to be show for which exception is not thrown.Any suggestions</p>
  
  <pre><code>public class Executor {
  
      public static void main(String args[]) throws InterruptedException{
  
          ExecutorService  executor=Executors.newFixedThreadPool(5);
  
          ArrayList&lt;Student&gt; list = new ArrayList&lt;Student&gt;();
          list.add(new Student("prerna"));
          list.add(new Student("abc"));
          list.add(new Student("archana"));
          list.add(new Student("def"));
          list.add(new Student("xyz"));
          list.add(new Student("ritu"));
          list.add(new Student("babita"));
  
          try {
              List&lt;Future&lt;String&gt;&gt; resultList=executor.invokeAll(list);
              for(Future&lt;String&gt; f:resultList){
                  //if(f.isDone()){
                      System.out.println(f.get());
                  //}
              }
          } catch (InterruptedException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
          }catch (ExecutionException e) {
              // TODO Auto-generated catch block
              System.out.println("HELLO SOME ERROR");
              //e.printStackTrace();
          }
  
          executor.shutdown();
          executor.awaitTermination(10, TimeUnit.SECONDS);
            System.out.println("Execution Completed");
  
      }
  }
  </code></pre>
  
  <p>.</p>
  
  <pre><code>public class Student implements Callable&lt;String&gt;{
      String name;
      public Student(String name) {
          super();
          this.name = name;
      }
  
      @Override
      public String call() throws Exception {
          // TODO Auto-generated method stub
          if(name=="archana"){
              throw new Exception();
          }
          return display(name);
      }
  
      private String display(String name2) {
          try {
          //  System.out.println(Thread.currentThread().getName());
              name2=Thread.currentThread().getName()+" Hello"+ name;
              Thread.sleep(1000);
          } catch (InterruptedException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
          }
          return name2;
      }
  
  }
  </code></pre>