code: public String getError(int index) {
      if (index < errors.size()) {
        ErrorDetails errorDetails = errors.get(index);
        return errorDetails.lineNumber + ". " + errorDetails.error;
      }
      return null;
    }
docs: Returns the error message otherwise returns null;
  
  @return error message