Skip to content

Commit 6c1c4ce

Browse files
committed
update docs
1 parent 45b1d7f commit 6c1c4ce

File tree

4 files changed

+16
-5
lines changed

4 files changed

+16
-5
lines changed

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,22 @@ For optional settings check the [docs](https://hexdocs.pm/sentry/readme.html).
3838

3939
### Setup with Plug or Phoenix
4040

41-
In your router add the following lines:
41+
In your Plug.Router or Phoenix.Router, add the following lines:
4242

4343
```elixir
4444
use Plug.ErrorHandler
4545
use Sentry.Plug
4646
```
4747

48+
If you are using Phoenix, you can also include [Sentry.Phoenix.Endpoint](https://hexdocs.pm/sentry/Sentry.Phoenix.Endpoint.html) in your Endpoint. This module captures errors occurring in the Phoenix pipeline before the request reaches the Router:
49+
50+
```elixir
51+
use Phoenix.Endpoint, otp_app: :my_app
52+
use Sentry.Phoenix.Endpoint
53+
```
54+
55+
More information on why this may be necessary can be found here: https://github.com/getsentry/sentry-elixir/issues/229 and https://github.com/phoenixframework/phoenix/issues/2791
56+
4857
### Capture All Exceptions
4958

5059
This library comes with an extension to capture all error messages that the Plug handler might not. This is based on the Erlang [error_logger](http://erlang.org/doc/man/error_logger.html).

docs/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ Filtering Events
115115
If you would like to prevent certain exceptions, the ``:filter`` configuration option
116116
allows you to implement the ``Sentry.EventFilter`` behaviour. The first argument is the
117117
exception to be sent, and the second is the source of the event. ``Sentry.Plug``
118-
will have a source of ``:plug``, and ``Sentry.Logger`` will have a source of ``:logger``.
118+
will have a source of ``:plug``, ``Sentry.Logger`` will have a source of ``:logger``, and ``Sentry.Phoenix.Endpoint`` will have a source of ``:endpoint``.
119119
If an exception does not come from either of those sources, the source will be nil
120120
unless the ``:event_source`` option is passed to ``Sentry.capture_exception/2``
121121

lib/sentry.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ defmodule Sentry do
5454
If you would like to prevent certain exceptions, the `:filter` configuration option
5555
allows you to implement the `Sentry.EventFilter` behaviour. The first argument is the
5656
exception to be sent, and the second is the source of the event. `Sentry.Plug`
57-
will have a source of `:plug`, and `Sentry.Logger` will have a source of `:logger`.
57+
will have a source of `:plug`, `Sentry.Logger` will have a source of `:logger`, and `Sentry.Phoenix.Endpoint` will have a source of `:endpoint`.
5858
If an exception does not come from either of those sources, the source will be nil
5959
unless the `:event_source` option is passed to `Sentry.capture_exception/2`
6060

lib/sentry/phoenix_endpoint.ex

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
defmodule Sentry.Phoenix.Endpoint do
22
@moduledoc """
3-
Provides basic functionality to handle errors in a Phoenix Endpoint. Errors occurring within a Phoenix request before it reaches the Router will not be captured by `Sentry.Plug` due to the internal workings of Phoenix.
3+
Provides basic functionality to handle errors in a Phoenix Endpoint. Errors occurring within a Phoenix request before it reaches the Router will not be captured by `Sentry.Plug` due to the internal functionality of Phoenix.
44
5-
For more information, see https://github.com/getsentry/sentry-elixir/issues/229.
5+
It is recommended to include `Sentry.Phoenix.Endpoint` in your Phoenix app if you would like to receive errors occurring in the previously mentioned circumstances.
6+
7+
For more information, see https://github.com/getsentry/sentry-elixir/issues/229 and https://github.com/phoenixframework/phoenix/issues/2791.
68
79
810
#### Usage

0 commit comments

Comments
 (0)