Why won't the catch block run?
<p>I have the following method to write an array to a text file. If a existing text file is given then it works fine but if a file that doesn't exist is given neither try-catch will run the code to restart the method. I'm not given any error or anything but the catch block won't run. I didn't think i would need to catch for an IOException but the code won't even run if i don't do that. So yea, anyone know how i can get this to work?    </p>

<p>Edit: Forgot to mention the getInput method prompts the user for input.</p>

<pre><code>private static void openFileWriter(String prompt, boolean append, int wordsperline, String[] story) {
  try {
    try {
      save = new PrintWriter(new FileWriter(getInput(prompt), append));
      wordsperline = 0;
      save.println("");
      save.println("");
      save.println("Story start");
      for (int x = 0; x &lt;= story.length-1; x++) {
        if (story[x] == null) {
        } else {
          if (wordsperline == 21) {
           save.println(story[x]);
           wordsperline = 0;
          } else {
           save.print(story[x]);
           wordsperline++;
          }
        }
      }
      save.close();
    } catch (FileNotFoundException e1) {
    openFileWriter("File not found", append,wordsperline,story);
    } 
  } catch (IOException e) {
    // TODO Auto-generated catch block
    openFileWriter("File not found", append,wordsperline,story);
  }
}
</code></pre>
