aboutsummaryrefslogtreecommitdiffstats
path: root/test/old_http_SUITE_data/http_errors.erl
diff options
context:
space:
mode:
Diffstat (limited to 'test/old_http_SUITE_data/http_errors.erl')
-rw-r--r--test/old_http_SUITE_data/http_errors.erl17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/old_http_SUITE_data/http_errors.erl b/test/old_http_SUITE_data/http_errors.erl
new file mode 100644
index 0000000..14e3d09
--- /dev/null
+++ b/test/old_http_SUITE_data/http_errors.erl
@@ -0,0 +1,17 @@
+%% Feel free to use, reuse and abuse the code in this file.
+
+-module(http_errors).
+
+-export([init/2]).
+
+init(Req, _Opts) ->
+ #{'case' := Case} = cowboy_req:match_qs(['case'], Req),
+ case_init(Case, Req).
+
+case_init(<<"init_before_reply">> = Case, _Req) ->
+ ct_helper_error_h:ignore(?MODULE, case_init, 2),
+ error(Case);
+case_init(<<"init_after_reply">> = Case, Req) ->
+ ct_helper_error_h:ignore(?MODULE, case_init, 2),
+ _ = cowboy_req:reply(200, #{}, "http_handler_crashes", Req),
+ error(Case).