mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-14 12:20:24 +00:00

Because the exit reason doesn't include the stacktrace they were ignored. Now they are properly handled. The error message was changed slightly to accomodate.
19 lines
412 B
Erlang
19 lines
412 B
Erlang
%% This module crashes immediately.
|
|
|
|
-module(crash_h).
|
|
|
|
-behaviour(cowboy_handler).
|
|
|
|
-export([init/2]).
|
|
|
|
-spec init(_, _) -> no_return().
|
|
init(_, external_exit) ->
|
|
ct_helper:ignore(?MODULE, init, 2),
|
|
exit(self(), ct_helper_ignore);
|
|
init(_, no_reply) ->
|
|
ct_helper:ignore(?MODULE, init, 2),
|
|
error(crash);
|
|
init(Req, reply) ->
|
|
_ = cowboy_req:reply(200, Req),
|
|
ct_helper:ignore(?MODULE, init, 2),
|
|
error(crash).
|