exsentry v0.7.1 ExSentry.Plug

ExSentry.Plug is a Plug error handler which can be used to automatically intercept and report to Sentry any exceptions encountered by a Plug-based web application.

To use, configure mix.exs and config.exs as described in README.md, then add use ExSentry.Plug near the top of your webapp’s plug stack, for example:

defmodule MyApp.Router do
  use MyApp.Web, :router
  use ExSentry.Plug

  pipeline :browser do
  ...

Available options:

  • exception_whitelist (list of modules) skips reporting on the given exception types

    use ExSentry.Plug, exception_whitelist: [ArgumentError]

  • plug_status_whitelist (list of integers) skips reporting on exception types with the given Plug status

    use ExSentry.Plug, plug_status_whitelist: [401, 403, 404]