Skip to content

Sentry not reporting on processes dying on uncaught exit() or throw() #446

@aselder

Description

@aselder

Environment

  • Elixir version (elixir -v): 1.11.2
  • Erlang/OTP version (erl): 23.0.4
  • Sentry version (mix deps): 8.0.4
  • Operating system: OS X
  • Is this an umbrella application?: yes
  • Release type (Distillery, mix release, Mix, etc.): release

Description

Inside of call, Sentry.PlugCapture only rescues from it's try block, it does not catch in addition to rescue. This means is a request dies because of a uncaught exit/1 or throw/1, this failure is not picked up by Sentry and the failure is never captured.

See https://github.com/phoenixframework/phoenix/blob/6f87ef24d02e6afc2634b4c42b20b1b5d89aebe5/lib/phoenix/endpoint.ex#L614-L631 for an example where Phoenix has very similar code in both a rescue block as well as a catch block.

Expected Behavior

If an request dies because of an uncaught exit/1 or throw/1, this error will be reported to Sentry.

Actual Behavior

Sentry does not capture this event.

Steps to Reproduce

  1. Create a phoenix app with sentry logging.
  2. Have an endpoint that triggers an exit, either call exit/1 directly or do something like GenServer.call(:some_non_existant_name, :foo, [])
  3. Phoenix will return a 500 for the request, but nothing will be captured in Sentry

See phoenixframework/phoenix#4099 which is related.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions