Skip to content

Commit 893e2e9

Browse files
Merge pull request #433 from josevalim/patch-1
Add Plug.Status filter example
2 parents 7c68ca9 + 280c2f0 commit 893e2e9

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lib/sentry/event_filter.ex

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,16 @@ defmodule Sentry.EventFilter do
1717
def exclude_exception?(_exception, _source), do: false
1818
end
1919
20+
Alternatively, if you want to skip all non-500 exceptions in a Plug app:
21+
22+
defmodule MyApp.SentryEventFilter do
23+
@behaviour Sentry.EventFilter
24+
25+
def exclude_exception?(exception, _) do
26+
Plug.Exception.status(exception) < 500
27+
end
28+
end
29+
2030
Sentry uses `Sentry.DefaultEventFilter` by default.
2131
"""
2232

0 commit comments

Comments
 (0)