code: public static File writeObjectToTempFileNoExceptions(Object o, String filename) {
      try {
        return writeObjectToTempFile(o, filename);
      } catch (Exception e) {
        System.err.println("Error writing object to file " + filename);
        e.printStackTrace();
        return null;
      }
    }
docs: Write object to a temp file and ignore exceptions.
  
  @param o
  object to be written to file
  @param filename
  name of the temp file
  @return File containing the object