extend/cowboy — pull request #530 by urbanserj (2013-06-03 13:12:46+00:00)
Title: Don't overwrite stackstace in `cowboy_rest:error_terminate/2`

This stacktrace is very useful in the `onresponse` hook. For example:

internal_error_hook(500, Headers, <<>>, Req) ->
StackTrace = erlang:get_stacktrace(),
Headers0 = [{N, V} || {N, V} <- Headers, N =/= <<"content-length">>],
Body = io_lib:format("~p", [StackTrace]),
{ok, Req0} = cowboy_req:reply(500, Headers0, Body, Req),
Req0;
internal_error_hook(Status, Headers, Body, Req) ->
{ok, Req0} = cowboy_req:reply(Status, Headers, Body, Req),
Req0.