aboutsummaryrefslogtreecommitdiffstats
path: root/src/cowboy_rest.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2012-09-15 20:33:57 +0200
committerLoïc Hoguin <[email protected]>2012-09-15 20:33:57 +0200
commitbb4bd9ac96d5fde5e8183c9950d3642062347a45 (patch)
tree1ca6ecc5575355c6c2f197ab3b53f1f90f0b2809 /src/cowboy_rest.erl
parent9b5cbb5000e564352afbd762c4ab0406250f147f (diff)
downloadcowboy-bb4bd9ac96d5fde5e8183c9950d3642062347a45.tar.gz
cowboy-bb4bd9ac96d5fde5e8183c9950d3642062347a45.tar.bz2
cowboy-bb4bd9ac96d5fde5e8183c9950d3642062347a45.zip
Add a cowboy_req:to_list/1 function
Removes a lot of duplicate code when printing error messages.
Diffstat (limited to 'src/cowboy_rest.erl')
-rw-r--r--src/cowboy_rest.erl2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cowboy_rest.erl b/src/cowboy_rest.erl
index 36a97f3..fc4279b 100644
--- a/src/cowboy_rest.erl
+++ b/src/cowboy_rest.erl
@@ -69,7 +69,7 @@ upgrade(_ListenerPid, Handler, Opts, Req) ->
service_available(Req, #state{handler=Handler})
end
catch Class:Reason ->
- PLReq = lists:zip(record_info(fields, http_req), tl(tuple_to_list(Req))),
+ PLReq = cowboy_req:to_list(Req),
error_logger:error_msg(
"** Handler ~p terminating in rest_init/3~n"
" for the reason ~p:~p~n** Options were ~p~n"