Skip to content

Commit b5b7bcc

Browse files
committed
check for excluded when sending test event
1 parent d14e866 commit b5b7bcc

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

lib/mix/tasks/sentry.send_test_event.ex

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,17 @@ defmodule Mix.Tasks.Sentry.SendTestEvent do
4343
if env_name in included_envs do
4444
Mix.shell.info "Sending test event..."
4545

46-
{:ok, id} = "Testing sending Sentry event"
46+
result = "Testing sending Sentry event"
4747
|> RuntimeError.exception
4848
|> Sentry.capture_exception(result: :sync)
4949

50-
Mix.shell.info "Test event sent! Event ID: #{id}"
50+
case result do
51+
{:ok, id} ->
52+
Mix.shell.info "Test event sent! Event ID: #{id}"
53+
:excluded ->
54+
Mix.shell.info "No test event was sent because the event was excluded by a filter"
55+
end
56+
5157
else
5258
Mix.shell.info "#{inspect env_name} is not in #{inspect included_envs} so no test event will be sent"
5359
end

0 commit comments

Comments
 (0)