From c56bada509a448348ba724841a27abed201b4861 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Wed, 24 Sep 2014 15:03:10 +0300 Subject: Remove the error tuple return value for middlewares It wasn't interesting compared to simply returning a halt tuple with an explicit reply. --- src/cowboy_protocol.erl | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/cowboy_protocol.erl') diff --git a/src/cowboy_protocol.erl b/src/cowboy_protocol.erl index a5873ea..82f1f38 100644 --- a/src/cowboy_protocol.erl +++ b/src/cowboy_protocol.erl @@ -428,9 +428,7 @@ execute(Req, State, Env, [Middleware|Tail]) -> erlang:hibernate(?MODULE, resume, [State, Env, Tail, Module, Function, Args]); {halt, Req2} -> - next_request(Req2, State, ok); - {error, Code, Req2} -> - error_terminate(Code, Req2, State) + next_request(Req2, State, ok) end. -spec resume(#state{}, cowboy_middleware:env(), [module()], @@ -443,9 +441,7 @@ resume(State, Env, Tail, Module, Function, Args) -> erlang:hibernate(?MODULE, resume, [State, Env, Tail, Module2, Function2, Args2]); {halt, Req2} -> - next_request(Req2, State, ok); - {error, Code, Req2} -> - error_terminate(Code, Req2, State) + next_request(Req2, State, ok) end. -spec next_request(cowboy_req:req(), #state{}, any()) -> ok. -- cgit v1.2.3