From 54b609185d3c734f9d0897b9c021ad1b016edafe Mon Sep 17 00:00:00 2001 From: Thelonius Kort Date: Tue, 31 Jan 2023 18:12:39 +0100 Subject: [PATCH] Fix issue in a botchy way --- lib/outlook/hyphenation.ex | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/outlook/hyphenation.ex b/lib/outlook/hyphenation.ex index 98bd333..ac7dc95 100644 --- a/lib/outlook/hyphenation.ex +++ b/lib/outlook/hyphenation.ex @@ -9,13 +9,18 @@ defmodule Outlook.Hyphenation do ] ) - response_raw = HTTPoison.request!( + case HTTPoison.request( :post, System.get_env("HYPH_URL"), form, get_multipart_headers() - ) - response_raw.body + ) do + {:ok, %HTTPoison.Response{status_code: 200, body: body}} -> + body + _ -> + # this is poor but for now better than loss of all work + html + end end defp get_multipart_form fields do