404 Error Handling Inside Plug?

How can i check its halted or not , currently inside the call/2 i am doing like follow

    body = "oops not found"
    conn
    |> put_resp_content_type("application/json")
    |> send_resp(404, body)
    |> halt