Hey, I'm having trouble getting a supervision tree set up.
I have the top-level 'application' file:
defmodule ERS do
use Application
@impl true
def start(_type, _args) do
ERS.Supervisor.start_link(name: ERS.Supervisor)
end
end
I have a 'supervisor' file:
defmodule ERS.Supervisor do
use Supervisor
def start_link(opts) do
Supervisor.start_link(__MODULE__, :ok, opts)
end
@impl true
def init(:ok) do
children = [Measurements, HTTP, Repo]
opts = [strategy: :one_for_one, name: ERS.Supervisor]
Supervisor.init(children, opts)
end
end
And the three children modules that I want supervised. Each of them have use Supervisor. When I try to run, I get the following:
** (EXIT) Measurements.init/1 returned a bad value: {:ok, []}```
I'm not sure how to write the necessary functions. Any advice?