Skip to content

Commit 6cb502d

Browse files
mk-fgprogval
authored andcommitted
Remove unnecessary json-decode on http errors in raw-client/poller
1 parent e4bf6c1 commit 6cb502d

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

lib/matrix/raw_client.ex

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,8 @@ defmodule M51.Matrix.RawClient do
3737
{:ok, %HTTPoison.Response{status_code: 200, body: body}} ->
3838
{:ok, Jason.decode!(body)}
3939

40-
{:ok, %HTTPoison.Response{status_code: status_code, body: <<?<, _::binary>> = body}} ->
41-
# That's not JSON!
42-
{:error, status_code, body}
43-
4440
{:ok, %HTTPoison.Response{status_code: status_code, body: body}} ->
45-
{:error, status_code, Jason.decode!(body)}
41+
{:error, status_code, body}
4642

4743
{:error, %HTTPoison.Error{reason: reason}} ->
4844
{:error, nil, reason}

0 commit comments

Comments
 (0)