Skip to content

Commit

Permalink
Merge pull request #339 from seb3s/patch-7
Browse files Browse the repository at this point in the history
allow a start error to properly propagate
  • Loading branch information
crertel authored Dec 7, 2023
2 parents 0cdf1bd + 5d407bb commit d3f1e6b
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions lib/scenic.ex
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,17 @@ defmodule Scenic do
def start_link(vps \\ [])

def start_link(vps) when is_list(vps) do
{:ok, pid} = Supervisor.start_link(__MODULE__, nil, name: :scenic)
case Supervisor.start_link(__MODULE__, nil, name: :scenic) do
{:ok, pid} ->
# start the default ViewPort
Enum.each(vps, &Scenic.ViewPort.start(&1))

# start the default ViewPort
Enum.each(vps, &Scenic.ViewPort.start(&1))
# return the original start_link value
{:ok, pid}

# return the original start_link value
{:ok, pid}
error ->
error
end
end

# --------------------------------------------------------
Expand Down

0 comments on commit d3f1e6b

Please sign in to comment.