code: private void handleIOException(IOException e) {
      String content = e.getLocalizedMessage();
      if (e instanceof RemoteException) {
        int eol = content.indexOf('\n');
        if (eol>=0) {
          content = content.substring(0, eol);
        }      
      }
      System.err.println(getCommandName() + ": " + content);
    }
docs: handle IOException