From 5f6b6b6f6d2fbae74d09a75d3b27446a99bc2d5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Thu, 29 Nov 2012 14:33:45 +0100 Subject: Add a better error message when user callbacks are not exported --- test/rest_missing_callbacks.erl | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 test/rest_missing_callbacks.erl (limited to 'test/rest_missing_callbacks.erl') diff --git a/test/rest_missing_callbacks.erl b/test/rest_missing_callbacks.erl new file mode 100644 index 0000000..171c856 --- /dev/null +++ b/test/rest_missing_callbacks.erl @@ -0,0 +1,21 @@ +-module(rest_missing_callbacks). +-export([init/3]). +-export([allowed_methods/2]). +-export([content_types_accepted/2]). +-export([content_types_provided/2]). + +init(_Transport, _Req, _Opts) -> + {upgrade, protocol, cowboy_rest}. + +allowed_methods(Req, State) -> + {[<<"GET">>, <<"PUT">>], Req, State}. + +content_types_accepted(Req, State) -> + {[ + {<<"application/json">>, put_application_json} + ], Req, State}. + +content_types_provided(Req, State) -> + {[ + {<<"text/plain">>, get_text_plain} + ], Req, State}. -- cgit v1.2.3