Skip to content

Commit 8aeb3dc

Browse files
authored
Merge pull request #10 from petrohi/master
Fix for non-HTTP error
2 parents 890a8bd + aa657b0 commit 8aeb3dc

3 files changed

Lines changed: 8 additions & 3 deletions

File tree

lib/segment/analytics.ex

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,12 @@ defmodule Segment.Analytics do
8989
end
9090

9191
defp log_result({_, %{status_code: code}}, function, body) do
92-
#every other failure
92+
#HTTP failure
9393
Logger.debug("Segment #{function} call failed: #{code} with body: #{body}")
9494
end
95+
96+
defp log_result(error, function, body) do
97+
#every other failure
98+
Logger.debug("Segment #{function} call failed: #{inspect(error)} with body: #{body}")
99+
end
95100
end

mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ defmodule AnalyticsElixir.Mixfile do
3131
defp deps do
3232
[
3333
{:httpoison, "~> 0.8"},
34-
{:poison, "~> 1.3 or ~> 2.0"},
34+
{:poison, "~> 3.1"},
3535
{:ex_doc, ">= 0.0.0", only: :dev}
3636
]
3737
end

mix.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
"idna": {:hex, :idna, "1.2.0", "ac62ee99da068f43c50dc69acf700e03a62a348360126260e87f2b54eced86b2", [:rebar3], []},
77
"metrics": {:hex, :metrics, "1.0.1", "25f094dea2cda98213cecc3aeff09e940299d950904393b2a29d191c346a8486", [:rebar3], []},
88
"mimerl": {:hex, :mimerl, "1.0.2", "993f9b0e084083405ed8252b99460c4f0563e41729ab42d9074fd5e52439be88", [:rebar3], []},
9-
"poison": {:hex, :poison, "1.5.2", "560bdfb7449e3ddd23a096929fb9fc2122f709bcc758b2d5d5a5c7d0ea848910", [:mix], []},
9+
"poison": {:hex, :poison, "3.1.0", "d9eb636610e096f86f25d9a46f35a9facac35609a7591b3be3326e99a0484665", [:mix], []},
1010
"ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.0", "edee20847c42e379bf91261db474ffbe373f8acb56e9079acb6038d4e0bf414f", [:make, :rebar], []}}

0 commit comments

Comments
 (0)