     nil
   catch
     kind, error ->
-      {kind, error, System.stacktrace}
+      {kind, error, System.stacktrace()}
   end
 end

  @name __MODULE__
  @supervisor 2
  @on_exit 3

  use Agent

  @spec start_link(keyword()) :: {:ok, pid}
  def start_link(_opts) do
    Agent.start_link(fn ->
      :ets.new(@name, [:public, :named_table, read_concurrency: true, write_concurrency: true])
    end, name: @name)
  end

  @spec register(pid) :: :ok

    receive do
      {^runner_pid, reason} ->
        {runner_pid, runner_monitor, error || reason}

      {:DOWN, ^runner_monitor, :process, ^runner_pid, reason} ->
        {nil, nil, error || {{:EXIT, runner_pid}, reason, []}}
    after
