Skip to content

Commit 769174b

Browse files
committed
Add plug parsing errors to list of default excluded params
Phoenix handles these errors by default. In addition, these errors are not really actionable by the application author, so they just contribute noise to the Sentry exception list.
1 parent 57cf8b5 commit 769174b

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

lib/sentry/default_event_filter.ex

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,15 @@ defmodule Sentry.DefaultEventFilter do
33

44
@moduledoc false
55

6-
def exclude_exception?(%x{}, :plug) when x in [Phoenix.Router.NoRouteError] do
6+
@ignored_exceptions [
7+
Phoenix.Router.NoRouteError,
8+
Plug.Parsers.RequestTooLarge,
9+
Plug.Parsers.BadEncodingError,
10+
Plug.Parsers.ParseError,
11+
Plug.Parsers.UnsupportedMediaTypeError
12+
]
13+
14+
def exclude_exception?(%x{}, :plug) when x in @ignored_exceptions do
715
true
816
end
917

0 commit comments

Comments
 (0)