title: Recursion in Error Handling?
body: <p>I'm writing a file reader that returns an object and I'd like it to warn on parse errors and continue to the next record.  </p>
  
  <p>The code below is the obvious implementation of this, but involves recursing from inside the catch block.  Is there any technical or stylistic reason not to do this?</p>
  
  <pre><code>public RecordType nextRecord() throws IOException{
      if (reader == null){
          throw new IllegalStateException("Reader closed.");
      }
      String line = reader.readLine();
      if (line == null){
          return null;
      }else{
          try {
              return parseRecord(line);
          }catch (ParseException pex){
              logger.warn("Record ignored due to parse error: " 
                  + pex.getMessage());
              //Note the recursion here
              return nextRecord();
          }
      }
  }
  </code></pre>