extend/cowboy — Issue #136: Misleading error message
Author: si14
Created: 2012-02-02 09:20:04+00:00
State: open

If one forgot to export content type callback (such as to_html), error message is very misleading:

```
=ERROR REPORT==== 2-Feb-2012::13:15:44 ===
** Handler webapi_watchmen terminating in rest_init/3
for the reason error:{case_clause,no_call}
** Options were []
** Request was {http_req,#Port<0.16828>,cowboy_tcp_transport,keepalive,
<0.974.0>,'GET',
{1,1},
undefined,
[<<"localhost">>],
undefined,<<"localhost">>,8083,
[<<"watchmen">>],
undefined,<<"/watchmen/">>,undefined,<<>>,[],
[{'Accept',<<"*/*">>},
{'Host',<<"localhost">>},
{'User-Agent',
<<"curl/7.21.4 (universal-apple-darwin11.0) libcurl/7.21.4 OpenSSL/0.9.8r zlib/1.2.5">>}],
[],undefined,[],waiting,<<>>,waiting,[],<<>>,
{#Fun,crash}}
** Stacktrace: [{cowboy_http_rest,set_resp_body,2,
[{file,"src/cowboy_http_rest.erl"},
{line,756}]},
{cowboy_http_rest,upgrade,4,
[{file,"src/cowboy_http_rest.erl"},
{line,63}]},
{cowboy_http_protocol,upgrade_protocol,3,
[{file,"src/cowboy_http_protocol.erl"},
{line,260}]}]
```