title: Java Custom Exception Handling
body: <p>I am looking for suggestion on how to handle exception in java in a scenario, where </p>
  
  <pre><code>Class A.test() 
  {
      ClassB.test1()
  }
  
  
  test1()
  {
     Map listOfExceptions = new HashMap();
     for()
     {
        try{
        }
        catch(custException e){
         // I want the for loop to continue even if there is an exception
         //So I am not throughing now rather adding the exception message to map with 
         //the field name for which for loop is running as key and message as value
        {
     }
  
  // at some point if map has &gt;0 records I want to throw an exception to classA.
  }
  </code></pre>
  
  <p>So the question here is how can I add the Map data to the exception thrown ? basically I need the list of exceptions to be sent to the calling method, as part of exception handling. 
  Is there a way we can do this ? 
  It might be a very silly question if the answer is wellknown but I dint find the exact answer anywhere. </p>