Skip to content

Commit

Permalink
Handle Poison 3.X decode error tuples
Browse files Browse the repository at this point in the history
Fixes #144
  • Loading branch information
keyan committed Dec 4, 2017
1 parent b5db7fe commit 262a1c2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/verk/job.ex
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ defmodule Verk.Job do
case Poison.decode(payload, as: %__MODULE__{}) do
{:ok, job} -> {:ok, %Verk.Job{job | original_json: payload}}
{:error, error} -> {:error, error}
{:error, :invalid, pos} -> {:error, "Invalid json at position: #{pos}"}
end
end

Expand Down

0 comments on commit 262a1c2

Please sign in to comment.