diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/cowboy_stream_h.erl | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/cowboy_stream_h.erl b/src/cowboy_stream_h.erl index cf1d38a..287fd95 100644 --- a/src/cowboy_stream_h.erl +++ b/src/cowboy_stream_h.erl @@ -161,12 +161,18 @@ report_crash(Ref, StreamID, Pid, Reason, Stacktrace) -> %% @todo Better spec. -spec request_process(_, _, _) -> _. request_process(Req, Env, Middlewares) -> + OTP = erlang:system_info(otp_release), try execute(Req, Env, Middlewares) catch exit:Reason -> Stacktrace = erlang:get_stacktrace(), erlang:raise(exit, {Reason, Stacktrace}, Stacktrace); + %% OTP 19 does not propagate any exception stacktraces, + %% we therefore add it for every class of exception. + _:Reason when OTP =:= "19" -> + Stacktrace = erlang:get_stacktrace(), + erlang:raise(exit, {Reason, Stacktrace}, Stacktrace); Class:Reason -> erlang:raise(Class, Reason, erlang:get_stacktrace()) end. |