code: public void setError(
          int errorIndex,
          String errorMessage
      ) {
  
          if (errorIndex >= 0) {
              this.errorMessage = (
                  ((errorMessage == null) || errorMessage.isEmpty())
                  ? ("Error occurred at position: " + errorIndex)
                  : errorMessage);
          } else {
              throw new IllegalArgumentException("Undefined error index: " + errorIndex);
          }
  
          this.pp.setErrorIndex(errorIndex);
  
      }
docs: /*[deutsch]
  <p>Setzt eine Fehlerinformation. </p>
  
  @param   errorIndex      error index in parsed text
  @param   errorMessage    error message maybe empty
  @throws  IllegalArgumentException if given error index is negative
  @since   3.0