I have this try-block

try {
      FileReader textFileReader = new FileReader(filename);
      BufferedReader textReader = new BufferedReader(textFileReader);
      
      String post = textReader.readLine();
      int weeknumber = Integer.valueOf(post);
      
      if (weeknumber != weeknmbr) {
       System.out.println("Wrong weeknumber.");
       return false;
      }
      
      post = textReader.readLine();
      while (post != null) {
        insertPost(post);
        post = textReader.readLine();
      }
      textReader.close();
    }

but I'm unsure which exceptions I should catch for it. I'm thinking IOException, but do I need one for weeknumber, and if so which? ArithmeticException maybe, or NumberFormatException or something?

Nevermind, I guess I don't need that since I have the if-sentence.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.