Commit 8a2c7444 authored by davecromberge's avatar davecromberge Committed by Heinz N. Gies

Fix badmatch when there are errors in query (#29)

parent 00908e46
......@@ -28,12 +28,12 @@ handle(Req, State) ->
Error = list_to_binary(dqe:error_string({error, E})),
lager:warning("Error in query [~s]: ~p", [Q, E]),
StatusCode = error_code(E),
{ok, Req2} =
{ok, ErrReq} =
cowboy_req:reply(StatusCode,
[{<<"content-type">>,
<<"text/plain">>}],
Error, Req1),
{ok, Req2, State};
Error, ReqR),
{ok, ErrReq, State};
{T, {ok, Start, R2}} ->
D = encode_reply(Start, T, R2),
{ContentType, ReqR1} = content_type(ReqR),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment