Don't track route not found errors

This commit is contained in:
Claudio Ortolina
2026-03-10 20:05:27 +00:00
parent fa535393e0
commit 20b497bbb8
3 changed files with 23 additions and 28 deletions
+18
View File
@@ -0,0 +1,18 @@
defmodule MusicLibrary.ErrorIgnorer do
@moduledoc """
Ignores errors that should not be tracked by ErrorTracker.
Bot scanners and crawlers routinely hit non-existent paths, generating
NoRouteError exceptions that are not actionable. We ignore them here
rather than blocking specific paths in the endpoint.
"""
@behaviour ErrorTracker.Ignorer
@ignored_kinds [
to_string(Phoenix.Router.NoRouteError)
]
@impl true
def ignore?(%ErrorTracker.Error{kind: kind}, _context) when kind in @ignored_kinds, do: true
def ignore?(_error, _context), do: false
end