The error shows "If any exception other than a NoSuchZipFileException occurs, then display "An error occurred. Please check the entered data." .please help
package com.codegym.task.task31.task3110;
import com.codegym.task.task31.task3110.command.ExitCommand;
import com.codegym.task.task31.task3110.exception.PathNotFoundException;
import com.codegym.task.task31.task3110.exception.NoSuchZipFileException;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.file.Path;
import java.nio.file.Paths;
public class Archiver {
public static void main(String[] args) throws IOException{
Operation operation = null;
try{
operation = askOperation();
CommandExecutor.execute(operation);
}catch (Exception e){}
while(operation != Operation.EXIT){
try{
operation = askOperation();
CommandExecutor.execute(operation);
}catch (NoSuchZipFileException e){
ConsoleHelper.writeMessage("You didn't select an archive or you selected an invalid file.");
}catch (Exception e){
ConsoleHelper.writeMessage("An error occurred.Please check the entered data.");
}
}
}
public static Operation askOperation() throws IOException{
Operation op = null;
ConsoleHelper.writeMessage("Select an operation: "+Operation.CREATE.ordinal()+" - Create an archive");
ConsoleHelper.writeMessage(Operation.ADD.ordinal()+" - Add a file to an archive");
ConsoleHelper.writeMessage(Operation.REMOVE.ordinal()+" - Remove a file from an archive");
ConsoleHelper.writeMessage(Operation.EXTRACT.ordinal()+" - Extract an archive");
ConsoleHelper.writeMessage(Operation.CONTENT.ordinal()+" - View the content of an archive");
ConsoleHelper.writeMessage(Operation.EXIT.ordinal()+" - Exit");
int c = ConsoleHelper.readInt();
for(Operation opp : Operation.values()){
if(opp.ordinal() == c)
op = opp;
}
return op;
}
}