Skip to content

Commit 7cbc843

Browse files
committed
Add missing error handling
1 parent 89583fc commit 7cbc843

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/matrix_client/client.ex

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,7 @@ defmodule M51.MatrixClient.Client do
329329
case M51.Matrix.RawClient.put(raw_client, path, body) do
330330
{:ok, %{"event_id" => event_id}} -> {:ok, event_id}
331331
{:error, nil, error} -> {:error, error}
332+
{:error, http_code, error} -> {:error, "Error #{http_code}: #{error}"}
332333
end
333334
end
334335

@@ -358,6 +359,7 @@ defmodule M51.MatrixClient.Client do
358359
case M51.Matrix.RawClient.get(raw_client, path) do
359360
{:ok, events} -> {:ok, events}
360361
{:error, nil, error} -> {:error, error}
362+
{:error, http_code, error} -> {:error, "Error #{http_code}: #{error}"}
361363
end
362364
end
363365

@@ -387,6 +389,7 @@ defmodule M51.MatrixClient.Client do
387389
case M51.Matrix.RawClient.get(raw_client, path) do
388390
{:ok, events} -> {:ok, events}
389391
{:error, nil, error} -> {:error, error}
392+
{:error, http_code, error} -> {:error, "Error #{http_code}: #{error}"}
390393
end
391394
end
392395

0 commit comments

Comments
 (0)