code: public void addError(Message message) throws CompilationFailedException {
          addErrorAndContinue(message);
  
          if (errors!=null && this.errors.size() >= configuration.getTolerance()) {
              failIfErrors();
          }
      }
docs: Adds a non-fatal error to the message set, which may cause a failure if the error threshold is exceeded.
  The message is not required to have a source line and column specified, but it is best practice to try
  and include that information.