You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+10-1Lines changed: 10 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,13 +38,22 @@ For optional settings check the [docs](https://hexdocs.pm/sentry/readme.html).
38
38
39
39
### Setup with Plug or Phoenix
40
40
41
-
In your router add the following lines:
41
+
In your Plug.Router or Phoenix.Router, add the following lines:
42
42
43
43
```elixir
44
44
usePlug.ErrorHandler
45
45
useSentry.Plug
46
46
```
47
47
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
+
usePhoenix.Endpoint, otp_app::my_app
52
+
useSentry.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
+
48
57
### Capture All Exceptions
49
58
50
59
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).
Copy file name to clipboardExpand all lines: docs/index.rst
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -115,7 +115,7 @@ Filtering Events
115
115
If you would like to prevent certain exceptions, the ``:filter`` configuration option
116
116
allows you to implement the ``Sentry.EventFilter`` behaviour. The first argument is the
117
117
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``.
119
119
If an exception does not come from either of those sources, the source will be nil
120
120
unless the ``:event_source`` option is passed to ``Sentry.capture_exception/2``
Copy file name to clipboardExpand all lines: lib/sentry/phoenix_endpoint.ex
+4-2Lines changed: 4 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,10 @@
1
1
defmoduleSentry.Phoenix.Endpointdo
2
2
@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.
4
4
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.
0 commit comments