def has_result(state, incorrect_msg="Your query did not return a result."):
    """Checks if the student's query returned a result.
    
    Args:
        incorrect_msg: If specified, this overrides the automatically generated feedback message
                       in case the student's query did not return a result.
    """

    # first check if there is no error
    has_no_error(state)

    if not state.solution_result:
        raise NameError(
            "You are using has_result() to verify that the student query generated an error, but the solution query did not return a result either!"
        )

    if not state.student_result:
        state.do_test(incorrect_msg)

    return state
Checks if the student's query returned a result.
    
    Args:
        incorrect_msg: If specified, this overrides the automatically generated feedback message
                       in case the student's query did not return a result.