Skip to content

Commit

Permalink
fix: return error when session not created (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
alinmarsh committed Oct 8, 2024
1 parent 38c9cce commit 645ac43
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/wallaby/webdriver_client.ex
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,13 @@ defmodule Wallaby.WebdriverClient do
def create_session(base_url, capabilities) do
params = %{desiredCapabilities: capabilities}

request(:post, "#{base_url}session", params)
case request(:post, "#{base_url}session", params) do
{:ok, %{"status" => status} = nonzero_status_response} when status != 0 ->
{:error, nonzero_status_response}

response ->
response
end
end

@doc """
Expand Down

0 comments on commit 645ac43

Please sign in to comment.