0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-16 05:00:24 +00:00

Handle error_response command in cowboy_metrics_h

This commit is contained in:
Grigory Starinkin 2018-10-20 10:11:14 +01:00 committed by Loïc Hoguin
parent 473e3fb82b
commit 5ab5615ff0
No known key found for this signature in database
GPG key ID: 8A9DF795F6FED764
3 changed files with 145 additions and 0 deletions

16
test/handlers/crash_h.erl Normal file
View file

@ -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).