Honeybadger.notify
You're seeing just the function
notify
, go back to Honeybadger module for more information.
Specs
notify(Honeybadger.Notice.noticeable()) :: :ok
Send an exception notification, if reporting is enabled.
This is the primary way to do manual error reporting and it is also used internally to deliver logged errors.
Stacktrace
Accessing the stacktrace outside of a rescue/catch is deprecated. Notifications should happen
inside of a rescue/catch block so that the stacktrace can be provided with __STACKTRACE__
.
Stacktraces must be provided and won't be automatically extracted from the current process.
Example
try do
do_something_risky()
rescue
exception ->
Honeybadger.notify(exception, metadata: %{}, stacktrace: __STACKTRACE__)
end
Send a notification directly from a string, which will be sent as a
RuntimeError
:
iex> Honeybadger.notify("custom error message")
:ok
Send a notification as a class
and message
:
iex> Honeybadger.notify(%{class: "SpecialError", message: "custom message"})
:ok
Send a notification as a badarg
atom:
iex> Honeybadger.notify(:badarg)
:ok
If desired additional metadata can be provided as well:
iex> Honeybadger.notify(%RuntimeError{}, metadata: %{culprit_id: 123})
:ok
If desired fingerprint can be provided as well:
iex> Honeybadger.notify(%RuntimeError{}, fingerprint: "culprit_id-123")
:ok
Specs
notify(Honeybadger.Notice.noticeable(), [notify_options()] | map()) :: :ok
This function is deprecated. Use Honeybadger.notify/2 instead.
Specs
notify(Honeybadger.Notice.noticeable(), map(), Exception.stacktrace()) :: :ok