Reducing Noise
Sometimes there are errors that you would rather not send to Honeybadger because
they are not actionable or are handled internally. By default Honeybadger will
be notified when any error occurs. To override this configuration in order not
to send out errors to Honeybadger, set exclude_errors
option in
config/config.exs
.
This can be done by passing a list of errors to be excluded:
elixir
config :honeybadger,
exclude_errors: ["RuntimeError"]
or
elixir
config :honeybadger,
exclude_errors: [RuntimeError]
Also you can implement the Honeybadger.ExcludeErrors
behaviour function
exclude_error?/1
, which receives the full Honeybadger.Notice
and returns a
boolean signalling the error exclusion or not.
elixir
defmodule ExcludeFunClauseErrors do
alias Honeybadger.ExcludeErrors
@behaviour ExcludeErrors
@impl ExcludeErrors
def exclude_error?(notice) do
notice.error.class == "FunctionClauseError"
end
end
elixir
config :honeybadger,
exclude_errors: ExcludeFunClauseErrors