code: public int errorCount() {
          if (werror && log.nerrors == 0 && log.nwarnings > 0) {
              log.error("warnings.and.werror");
          }
          return log.nerrors;
      }
docs: The number of errors reported so far.