File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -152,6 +152,18 @@ defmodule Sentry.LoggerHandlerTest do
152152 % { test_genserver: start_supervised! ( TestGenServer , restart: :temporary ) }
153153 end
154154
155+ test "a GenServer raising an error is reported" ,
156+ % { sender_ref: ref , test_genserver: test_genserver } do
157+ run_and_catch_exit ( test_genserver , fn -> Keyword . fetch! ( [ ] , :foo ) end )
158+
159+ assert_receive { ^ ref , event }
160+ assert % KeyError { } = event . original_exception
161+ assert [ exception ] = event . exception
162+ assert exception . type == "KeyError"
163+ assert exception . value == "key :foo not found in: []"
164+ assert Enum . find ( exception . stacktrace . frames , & ( & 1 . function =~ "Keyword.fetch!/2" ) )
165+ end
166+
155167 test "a GenServer throw is reported" , % { sender_ref: ref , test_genserver: test_genserver } do
156168 run_and_catch_exit ( test_genserver , fn ->
157169 throw ( :testing_throw )
You can’t perform that action at this time.
0 commit comments