aboutsummaryrefslogtreecommitdiffstats
path: root/test/handlers
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2018-08-13 17:23:48 +0200
committerLoïc Hoguin <[email protected]>2018-08-13 17:23:48 +0200
commit0a5fadc60bc586946ebd3b17839bcaf13b76f6d0 (patch)
tree4e8122d59c486273d894296c0aba502f155e3687 /test/handlers
parent06a3a93de0bb6bdd0759f658b7826f38a50bb8a6 (diff)
downloadcowboy-0a5fadc60bc586946ebd3b17839bcaf13b76f6d0.tar.gz
cowboy-0a5fadc60bc586946ebd3b17839bcaf13b76f6d0.tar.bz2
cowboy-0a5fadc60bc586946ebd3b17839bcaf13b76f6d0.zip
Improve errors for when the ProvideCallback is missing
Diffstat (limited to 'test/handlers')
-rw-r--r--test/handlers/provide_callback_missing_h.erl11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/handlers/provide_callback_missing_h.erl b/test/handlers/provide_callback_missing_h.erl
new file mode 100644
index 0000000..c9419ad
--- /dev/null
+++ b/test/handlers/provide_callback_missing_h.erl
@@ -0,0 +1,11 @@
+-module(provide_callback_missing_h).
+
+-export([init/2]).
+-export([content_types_provided/2]).
+
+init(Req, State) ->
+ {cowboy_rest, Req, State}.
+
+content_types_provided(Req, State) ->
+ ct_helper_error_h:ignore(cowboy_rest, set_resp_body, 2),
+ {[{<<"text/plain">>, provide}], Req, State}.