Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions guides/Getting Started.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,19 @@ The `ErrorTracker.Ignorer` behaviour allows you to ignore errors based on their

When an error is ignored, its occurrences are not tracked at all. This is useful for expected errors that you don't want to store in your database.

For example, if you had an integration with an unreliable third-party system that was frequently timing out, you could ignore those errors like so:

```elixir
defmodule MyApp.ErrorIgnores do
@behaviour ErrorTracker.Ignorer

@impl ErrorTracker.Ignorer
def ignore?(%{kind: "Elixir.UnreliableThirdParty.Error", reason: ":timeout"} = _error, _context) do
true
end
end
```

### Muting Errors

Sometimes you may want to keep tracking error occurrences but avoid receiving notifications about them. For these cases,
Expand Down
8 changes: 7 additions & 1 deletion lib/error_tracker/schemas/error.ex
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@ defmodule ErrorTracker.Error do

use Ecto.Schema

@type t :: %__MODULE__{}
@type t :: %__MODULE__{
kind: string(),
reason: string(),
source_line: string(),
source_function: string(),
status: :resolved | :unresolved
}

schema "error_tracker_errors" do
field :kind, :string
Expand Down