def update_error_message(err_message, match, matches, allow_profanity, i):
    """Update Error Message Function

    Update error message string with the match's error type.  Omits profanity if allowed.
    """
    if match['shortMessage'] == "Profanity":
        if allow_profanity is not True:
            err_message += match['shortMessage'] + ", "
    elif i == (len(matches) - 1):
        err_message += match['shortMessage']
    else:
        err_message += match['shortMessage'] + ", "
    return err_message