diff options
Diffstat (limited to 'test/handlers')
-rw-r--r-- | test/handlers/crash_h.erl | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/handlers/crash_h.erl b/test/handlers/crash_h.erl new file mode 100644 index 0000000..b687aba --- /dev/null +++ b/test/handlers/crash_h.erl @@ -0,0 +1,16 @@ +%% This module crashes immediately. + +-module(crash_h). + +-behaviour(cowboy_handler). + +-export([init/2]). + +-spec init(_, _) -> no_return(). +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). |