Skip to content

Commit f0a35fe

Browse files
committed
Fix Dialyzer in tests
1 parent 24c320e commit f0a35fe

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

.dialyzer_ignore.exs

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[
2+
{"test/support/example_plug_application.ex"}
3+
]

lib/sentry/plug_capture.ex

+9-3
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,16 @@ defmodule Sentry.PlugCapture do
101101
rescue
102102
err in Plug.Conn.WrapperError ->
103103
exception = Exception.normalize(:error, err.reason, err.stack)
104-
Sentry.PlugCapture.__capture_exception__(exception, err.stack, @__sentry_scrubber)
104+
105+
:ok =
106+
Sentry.PlugCapture.__capture_exception__(exception, err.stack, @__sentry_scrubber)
107+
105108
Plug.Conn.WrapperError.reraise(err)
106109

107110
exc ->
108-
Sentry.PlugCapture.__capture_exception__(exc, __STACKTRACE__, @__sentry_scrubber)
111+
:ok =
112+
Sentry.PlugCapture.__capture_exception__(exc, __STACKTRACE__, @__sentry_scrubber)
113+
109114
:erlang.raise(:error, exc, __STACKTRACE__)
110115
catch
111116
kind, reason ->
@@ -132,7 +137,8 @@ defmodule Sentry.PlugCapture do
132137
exception
133138
end
134139

135-
Sentry.capture_exception(exception, stacktrace: stacktrace, event_source: :plug)
140+
_ = Sentry.capture_exception(exception, stacktrace: stacktrace, event_source: :plug)
141+
:ok
136142
end
137143

138144
@doc false

test/support/test_environment_helper.ex

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ defmodule Sentry.TestEnvironmentHelper do
7777
:persistent_term.erase(key)
7878
end
7979

80-
ExUnit.CaptureLog.capture_log(fn -> Application.stop(:sentry) end)
80+
_log = ExUnit.CaptureLog.capture_log(fn -> Application.stop(:sentry) end)
8181
assert {:ok, _} = Application.ensure_all_started(:sentry)
8282
end
8383
end

0 commit comments

Comments
 (0)