Skip to content

Commit 344ae6d

Browse files
authored
Merge pull request #165 from danschultzer/surface-retriever-startup-error
Surface retriever startup error
2 parents 8c8cf50 + a739299 commit 344ae6d

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

lib/money/exchange_rates/exchange_rates_supervisor.ex

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ defmodule Money.ExchangeRates.Supervisor do
3838
options = Keyword.merge(default_options(), options)
3939
if options[:restart], do: stop()
4040
supervisor = start_link()
41-
if options[:start_retriever], do: ExchangeRates.Retriever.start()
41+
if options[:start_retriever], do: start_retriever!()
4242
supervisor
4343
end
4444

@@ -189,4 +189,11 @@ defmodule Money.ExchangeRates.Supervisor do
189189
defp retriever_spec(config) do
190190
%{id: @child_name, start: {@child_name, :start_link, [@child_name, config]}}
191191
end
192+
193+
defp start_retriever! do
194+
case ExchangeRates.Retriever.start() do
195+
{:ok, _pid} -> :ok
196+
{:error, reason} -> raise "Unhandled error starting retriever; #{inspect reason}"
197+
end
198+
end
192199
end

0 commit comments

Comments
 (0)