Skip to content

Commit

Permalink
Report all errors to Sentry
Browse files Browse the repository at this point in the history
  • Loading branch information
joshsmith committed Nov 19, 2017
1 parent 2f5a341 commit ac871ae
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ config :stripity_stripe,

config :sentry,
dsn: System.get_env("SENTRY_DSN"),
included_environments: ~w(prod staging)a,
use_error_logger: true
enable_source_code_context: true,
included_environments: ~w(prod staging)a

config :code_corps, :sentry, CodeCorps.Sentry.Async

Expand Down
5 changes: 5 additions & 0 deletions lib/code_corps.ex
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ defmodule CodeCorps do
# See http://elixir-lang.org/docs/stable/elixir/Supervisor.html
# for other strategies and supported options
opts = [strategy: :one_for_one, name: CodeCorps.Supervisor]

if !(Sentry.Logger in :gen_event.which_handlers(:error_logger)) do
:ok = :error_logger.add_report_handler(Sentry.Logger)
end

Supervisor.start_link(children, opts)
end

Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ defmodule CodeCorps.Mixfile do
def application do
[
mod: {CodeCorps, []},
extra_applications: [:scout_apm, :timex, :tzdata]
extra_applications: [:sentry, :logger, :scout_apm, :timex, :tzdata]
]
end

Expand Down

0 comments on commit ac871ae

Please sign in to comment.