From 5ab5615ff0bc13e449cc3ff7ef528ffdeb1feb1f Mon Sep 17 00:00:00 2001 From: Grigory Starinkin Date: Sat, 20 Oct 2018 10:11:14 +0100 Subject: Handle error_response command in cowboy_metrics_h --- test/handlers/crash_h.erl | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 test/handlers/crash_h.erl (limited to 'test/handlers') 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). -- cgit v1.2.3