From 262a1c2c3345775a8572b3d906f95dce87f8324d Mon Sep 17 00:00:00 2001 From: Keyan Pishdadian Date: Mon, 4 Dec 2017 16:59:22 -0500 Subject: [PATCH] Handle Poison 3.X decode error tuples Fixes #144 --- lib/verk/job.ex | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/verk/job.ex b/lib/verk/job.ex index b4f867e..aafbddf 100644 --- a/lib/verk/job.ex +++ b/lib/verk/job.ex @@ -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