Skip to content

Commit ab3ba77

Browse files
committed
Capture plug errors
1 parent 785a418 commit ab3ba77

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

lib/error_tracker/plug.ex

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ defmodule ErrorTracker.Plug do
44
use Plug.ErrorHandler
55

66
@impl Plug.ErrorHandler
7-
def handle_errors(conn, %{kind: kind, reason: reason, stack: stack}) do
7+
def handle_errors(conn, %{kind: :error, reason: exception, stack: stack}) do
8+
ErrorTracker.report(exception, stack)
89

10+
:ok
11+
end
912

10-
dbg kind
11-
dbg reason
12-
dbg stack
13-
13+
def handle_errors(conn, _throw_or_exit) do
1414
:ok
1515
end
1616
end

0 commit comments

Comments
 (0)