aboutsummaryrefslogtreecommitdiffstats
path: root/test/handlers/crash_h.erl
blob: 57d4d85b0cd2973c132b7c14e9384d249f05e2f9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
%% 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).