def form_errors_exists(form, code):
    """
    Check that a given code error form exists.
    """
    for error in form.non_field_errors().as_data():
        if error.code == code:
            return True

    return False