Skip to content

Commit

Permalink
fix: do not raise when start_link fails
Browse files Browse the repository at this point in the history
  • Loading branch information
tlux committed Mar 29, 2024
1 parent 561ca3e commit c09c69b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
6 changes: 2 additions & 4 deletions lib/graphql_ws_client/iterator.ex
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,8 @@ defmodule GraphQLWSClient.Iterator do
|> Opts.new()
|> Opts.validate!()

case start_link(opts) do
{:ok, iterator} -> iterator
{:error, error} -> raise error
end
{:ok, iterator} = start_link(opts)
iterator
end

@spec close(iterator) :: :ok
Expand Down
1 change: 0 additions & 1 deletion test/graphql_ws_client/iterator_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ defmodule GraphQLWSClient.IteratorTest do
alias GraphQLWSClient.Iterator
alias GraphQLWSClient.Iterator.Opts
alias GraphQLWSClient.Message
alias GraphQLWSClient.SocketError

setup :set_mox_from_context
setup :verify_on_exit!
Expand Down

0 comments on commit c09c69b

Please sign in to comment.