benjamintanweihao / the-little-elixir-otp-guidebook-code

Code examples for The Little Elixir & OTP Guidebook
372 stars 71 forks source link

Error in handle_call with :restart_child - Missing parameter #16

Open f-lombardo opened 6 years ago

f-lombardo commented 6 years ago

Steps to reproduce the error: iex(2)> {:ok, sup_pid} = ThySupervisor.start_link([]) {:ok, #PID<0.157.0>} iex(3)> {:ok, child_pid} = ThySupervisor.start_child(sup_pid, {ThyWorker, :start_link, []}) {:ok, #PID<0.159.0>} iex(4)> {:ok, child_pid} = ThySupervisor.restart_child(sup_pid, child_pid, {ThyWorker, :start_link, []}) (EXIT from #PID<0.143.0>) evaluator process exited with reason: an exception was raised: (FunctionClauseError) no function clause matching in ThySupervisor.handle_call/3

f-lombardo commented 6 years ago

Sorry, I didn't see that this is the same as #9