mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-14 12:20:24 +00:00
Get stacktrace before executing rest_terminate
At present, the resulting stacktrace will be misleading about where the underlying error occurred.
This commit is contained in:
parent
3d9078018d
commit
57671cbbb0
1 changed files with 1 additions and 1 deletions
|
@ -999,8 +999,8 @@ terminate(Req, State=#state{env=Env}) ->
|
||||||
|
|
||||||
error_terminate(Req, State=#state{handler=Handler, handler_state=HandlerState},
|
error_terminate(Req, State=#state{handler=Handler, handler_state=HandlerState},
|
||||||
Class, Reason, Callback) ->
|
Class, Reason, Callback) ->
|
||||||
rest_terminate(Req, State),
|
|
||||||
Stacktrace = erlang:get_stacktrace(),
|
Stacktrace = erlang:get_stacktrace(),
|
||||||
|
rest_terminate(Req, State),
|
||||||
cowboy_req:maybe_reply(Stacktrace, Req),
|
cowboy_req:maybe_reply(Stacktrace, Req),
|
||||||
erlang:Class([
|
erlang:Class([
|
||||||
{reason, Reason},
|
{reason, Reason},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue