Packages
honeybadger
0.27.0
0.28.0
0.27.0
0.26.0
0.25.0
0.24.1
0.24.0
0.23.0
0.22.1
0.22.0
0.21.0
0.20.0
0.19.0
0.18.1
0.18.0
0.17.0
0.16.4
0.16.3
0.16.2
0.16.1
0.16.0
0.15.0
0.14.1
0.14.0
0.13.1
0.13.0
0.12.1
0.12.0
0.11.0
0.10.3
0.10.2
0.10.1
0.10.0
0.9.0
0.8.0
0.7.0
0.7.0-beta
0.6.3
0.6.2
0.6.1
0.6.0
0.5.0
0.4.0
0.3.1
0.3.0
0.2.0
0.1.2
0.1.1
0.1.0
Elixir client, Plug and error_logger for integrating with the Honeybadger.io exception tracker"
Current section
Files
Jump to
Current section
Files
lib/honeybadger/filter.ex
defmodule Honeybadger.Filter do
alias Honeybadger.Breadcrumbs.Breadcrumb
@moduledoc """
Specification of user overrideable filter functions.
See moduledoc for `Honeybadger.Filter.Mixin` for details on implementing
your own filter.
"""
@doc """
Filter the context Map. The context is a map of application supplied data.
"""
@callback filter_context(map) :: map
@doc """
For applications that use `Honeybadger.Plug`, filters the query parameters.
The parameters is a map of `String.t` to `String.t`, e.g.:
%{"user_name" => "fred", "password" => "12345"}
"""
@callback filter_params(map) :: map
@doc """
For applications that use `Honeybadger.Plug`, filter the cgi_data.
`cgi_data` is a map of `String.t` to `String.t` which includes HTTP headers
and other pre-defined request data (including `PATH_INFO`, `QUERY_STRING`,
`SERVER_PORT` etc.).
"""
@callback filter_cgi_data(map) :: map
@doc """
For applications that use `Honeybadger.Plug`, filter the session.
"""
@callback filter_session(map) :: map
@doc """
Filter the error message string. This is the message from the most
recently thrown error.
"""
@callback filter_error_message(String.t()) :: String.t()
@doc """
Filter breadcrumbs. This filter function receives a list of Breadcrumb
structs. You could use any Enum function to constrain the set. Let's say you
want to remove any breadcrumb that have metadata that contain SSN:
def filter_breadcrumbs(breadcrumbs) do
Enum.reject(breadcrumbs, fn breadcrumb -> do
Map.has_key?(breadcrumb.metadata, :ssn)
end)
end
"""
@callback filter_breadcrumbs([Breadcrumb.t()]) :: [Breadcrumb.t()]
end