Is there any standard way to catch the exception in controllers and send a custom response to the client as the fallback controller does not get called on exceptions
action_fallback SocketEngineWeb.FallbackController
def get_online_status(conn, %{"userIds" => user_ids} = params) do
try do
{:ok, online_status} = user_ids |> Jason.decode!() |> ChatTracker.get_online_status()
conn |> send_response(200, "status fetched", %{"status" => online_status})
rescue
err -> err
end
end