aboutsummaryrefslogtreecommitdiffstats
path: root/test/handlers
diff options
context:
space:
mode:
authorGrigory Starinkin <[email protected]>2018-10-20 10:11:14 +0100
committerLoïc Hoguin <[email protected]>2018-10-31 15:13:23 +0100
commit5ab5615ff0bc13e449cc3ff7ef528ffdeb1feb1f (patch)
tree1f7bb40c661cc253b3078f8efc1a8d014c38ca3e /test/handlers
parent473e3fb82bd56a984dcf8936a51e3fd8affcb8f4 (diff)
downloadcowboy-5ab5615ff0bc13e449cc3ff7ef528ffdeb1feb1f.tar.gz
cowboy-5ab5615ff0bc13e449cc3ff7ef528ffdeb1feb1f.tar.bz2
cowboy-5ab5615ff0bc13e449cc3ff7ef528ffdeb1feb1f.zip
Handle error_response command in cowboy_metrics_h
Diffstat (limited to 'test/handlers')
-rw-r--r--test/handlers/crash_h.erl16
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).