Files
firezone/elixir/apps/web/lib/web/live_errors.ex
Jamil 28559a317f chore(portal): Optionally drop NotFoundError to sentry (#8183)
By specifying the `before_send` hook, we can easily drop events based on
their data, such as `original_exception` which contains the original
exception instance raised.

Leveraging this, we can add a `report_to_sentry` parameter to
`Web.LiveErrors.NotFound` to optionally ignore certain not found errors
from going to Sentry.
2025-02-18 21:55:23 +00:00

22 lines
562 B
Elixir

defmodule Web.LiveErrors do
defmodule NotFoundError do
defexception message: "Not Found", report_to_sentry: true
defimpl Plug.Exception do
def status(_exception), do: 404
def actions(_exception), do: []
end
end
# this is not a styled error because only security scanners that
# try to manipulate the request will see it
defmodule InvalidParamsError do
defexception message: "Unprocessable Entity"
defimpl Plug.Exception do
def status(_exception), do: 422
def actions(_exception), do: []
end
end
end