Skip to content

Commit 028a542

Browse files
committed
also log error
1 parent b6c9f83 commit 028a542

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/sentry/client.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@ defmodule Sentry.Client do
139139
error_header = :proplists.get_value("X-Sentry-Error", headers, "")
140140
log_api_error("#{body}\nReceived #{status} from Sentry server: #{error_header}")
141141
:error
142-
_ ->
143-
log_api_error(body)
142+
e ->
143+
log_api_error("#{inspect(e)}\n#{body}")
144144
:error
145145
end
146146
end

test/mix/sentry.send_test_event_test.exs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ defmodule Mix.Tasks.Sentry.SendTestEventTest do
5050

5151
test "handles :error when Sentry server is unreachable" do
5252
modify_env(:sentry, [dsn: "http://public:secret@localhost:0/1"])
53-
capture_log(fn ->
53+
assert capture_log(fn ->
5454
assert capture_io(fn ->
5555
Mix.Tasks.Sentry.SendTestEvent.run([])
5656
end) == """
@@ -65,6 +65,6 @@ defmodule Mix.Tasks.Sentry.SendTestEventTest do
6565
Sending test event...
6666
Error sending event!
6767
"""
68-
end)
68+
end) =~ "Failed to send Sentry event"
6969
end
7070
end

0 commit comments

Comments
 (0)