diff --git a/guides/Getting Started.md b/guides/Getting Started.md index d94c3bc..a1bcd8f 100644 --- a/guides/Getting Started.md +++ b/guides/Getting Started.md @@ -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, diff --git a/lib/error_tracker/schemas/error.ex b/lib/error_tracker/schemas/error.ex index d2d8d4c..643332b 100644 --- a/lib/error_tracker/schemas/error.ex +++ b/lib/error_tracker/schemas/error.ex @@ -12,7 +12,16 @@ defmodule ErrorTracker.Error do use Ecto.Schema - @type t :: %__MODULE__{} + @type t :: %__MODULE__{ + kind: String.t(), + reason: String.t(), + source_line: String.t(), + source_function: String.t(), + status: :resolved | :unresolved, + fingerprint: String.t(), + last_occurrence_at: DateTime.t(), + muted: boolean() + } schema "error_tracker_errors" do field :kind, :string