Debian Codegraph @

test/handlers/crash_h.erl

raw
1 %% This module crashes immediately.
2
3 -module(crash_h).
4
5 -behaviour(cowboy_handler).
6
7 -export([init/2]).
8
9 -spec init(_, _) -> no_return().
10 init(_, external_exit) ->
11 ct_helper:ignore(?MODULE, init, 2),
12 exit(self(), ct_helper_ignore);
13 init(_, no_reply) ->
14 ct_helper:ignore(?MODULE, init, 2),
15 error(crash);
16 init(Req, reply) ->
17 _ = cowboy_req:reply(200, Req),
18 ct_helper:ignore(?MODULE, init, 2),
19 error(crash).