From 66f7206b47bcb75e6e4537c8b07fff356a172b54 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Sat, 21 Dec 2019 22:56:10 -0500 Subject: [PATCH] Add fallback handler for unknown response codes --- lib/frenzy/http.ex | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/frenzy/http.ex b/lib/frenzy/http.ex index c4a6975..54e1a0e 100644 --- a/lib/frenzy/http.ex +++ b/lib/frenzy/http.ex @@ -36,6 +36,9 @@ defmodule Frenzy.HTTP do {:ok, %HTTPoison.Response{status_code: 404}} -> {:error, "404 Not Found"} + {:ok, %HTTPoison.Response{status_code}} -> + {:error, "HTTP #{status_code}"} + {:error, %HTTPoison.Error{reason: reason}} -> {:error, reason} end