code: public void prompt() {
          if (promptOnError) {
              System.err.println(localize("resume.abort"));
              try {
                  while (true) {
                      switch (System.in.read()) {
                      case 'a': case 'A':
                          System.exit(-1);
                          return;
                      case 'r': case 'R':
                          return;
                      case 'x': case 'X':
                          throw new AssertionError("user abort");
                      default:
                      }
                  }
              } catch (IOException e) {}
          }
      }
docs: Prompt user after an error.