def METHOD_NAME():
    function = mlrun.new_function("tests", kind="serving")
    graph = function.set_topology("flow", engine="async")
    chain = graph.to("Chain", name="s1")
    chain.to("Raiser").error_handler(
        name="catch", class_name="EchoError", full_event=True
    ).to("Chain", name="s3")
    function.verbose = True
    server = function.to_mock_server()
    # plot the graph for test & debug
    graph.plot(f"{results}/serving/on_error.png")
    resp = server.test(body=[])
    server.wait_for_completion()
    if isinstance(resp, dict):
        assert (
            resp["error"] and resp["origin_state"] == "Raiser"
        ), f"error wasn't caught, resp={resp}"
    else:
        assert (
            resp.error and resp.origin_state == "Raiser"
        ), f"error wasn't caught, resp={resp}"