Skip to content

Commit 80294a5

Browse files
Update README.md
1 parent d819f4c commit 80294a5

File tree

1 file changed

+25
-24
lines changed

1 file changed

+25
-24
lines changed

README.md

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -21,29 +21,6 @@ defp deps do
2121
end
2222
```
2323

24-
### Capture Exceptions
25-
26-
Sometimes you want to capture specific exceptions. To do so, use `Sentry.capture_exception/2`.
27-
28-
```elixir
29-
try do
30-
ThisWillError.reall()
31-
rescue
32-
my_exception ->
33-
Sentry.capture_exception(my_exception, [stacktrace: System.stacktrace(), extra: %{extra: information}])
34-
end
35-
```
36-
37-
### Capture Non-Exception Events
38-
39-
Sometimes you want to capture arbitrary messages that are not Exceptions.
40-
41-
```elixir
42-
Sentry.capture_message("custom_event_name", extra: %{extra: information})
43-
```
44-
45-
For optional settings check the [docs](https://hexdocs.pm/sentry/readme.html).
46-
4724
### Setup with Plug or Phoenix
4825

4926
In your Plug.Router or Phoenix.Router, add the following lines:
@@ -62,7 +39,7 @@ use Sentry.Phoenix.Endpoint
6239

6340
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
6441

65-
### Capture All Exceptions
42+
### Capture Crashed Process Exceptions
6643

6744
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).
6845

@@ -83,6 +60,30 @@ def start(_type, _opts) do
8360
end
8461
```
8562

63+
### Capture Arbitrary Exceptions
64+
65+
Sometimes you want to capture specific exceptions. To do so, use `Sentry.capture_exception/2`.
66+
67+
```elixir
68+
try do
69+
ThisWillError.reall()
70+
rescue
71+
my_exception ->
72+
Sentry.capture_exception(my_exception, [stacktrace: System.stacktrace(), extra: %{extra: information}])
73+
end
74+
```
75+
76+
### Capture Non-Exception Events
77+
78+
Sometimes you want to capture messages that are not Exceptions.
79+
80+
```elixir
81+
Sentry.capture_message("custom_event_name", extra: %{extra: information})
82+
```
83+
84+
For optional settings check the [docs](https://hexdocs.pm/sentry/readme.html).
85+
86+
8687
## Configuration
8788

8889
| Key | Required | Default | Notes |

0 commit comments

Comments
 (0)