title: Don't know how to handle FileWriter exceptions
body: <p>In my code, one of my methods says:</p>
  
  <pre><code>this.write("stuff")
  </code></pre>
  
  <p>and the write method is</p>
  
  <pre><code>public void write(String text) throws IOException
  {
      FileWriter writer = new FileWriter(path, true);
      PrintWriter printer = new PrintWriter(writer);
      printer.printf("%s" + "%n", text);
      printer.close();
  }
  </code></pre>
  
  <p>The thing says that there is an 
  <code>"unreported exception java.io.IOException; must be caught or declared to be thrown"</code> for the FileWriter.</p>
  
  <p>What should I put in the try and catch statements to fix the exception?</p>