From a1065bd78af88b31e53c8057507130711cbe451d Mon Sep 17 00:00:00 2001 From: Dylan Chong Date: Thu, 12 May 2022 18:26:48 +1200 Subject: [PATCH] Fix: Connection closed error creates case clause exception --- lib/cqex/query.ex | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/cqex/query.ex b/lib/cqex/query.ex index e19d969..5dffa01 100644 --- a/lib/cqex/query.ex +++ b/lib/cqex/query.ex @@ -101,6 +101,10 @@ defmodule CQEx.Query do {:error, %{msg: "#{message} (Code #{code})\nStatement: #{s}\nValues: #{inspect(v)}", acc: []}} + {{s, v}, {:error, e}} -> + {:error, + %{msg: "#{inspect(e)} \nStatement: #{s}\nValues: #{inspect(v)}", acc: []}} + {:error, {code, message, _extras}} -> {:error, %{msg: "#{message} (Code #{code})", acc: []}} end