aboutsummaryrefslogtreecommitdiffstats
path: root/src/cowboy_protocol.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2014-09-24 15:03:10 +0300
committerLoïc Hoguin <[email protected]>2014-09-24 15:03:10 +0300
commitc56bada509a448348ba724841a27abed201b4861 (patch)
tree10162f5c47ad8394f74f12e4105e20488e9c3fd1 /src/cowboy_protocol.erl
parentaa4d86b81f6095316813c599659014c15bf9b935 (diff)
downloadcowboy-c56bada509a448348ba724841a27abed201b4861.tar.gz
cowboy-c56bada509a448348ba724841a27abed201b4861.tar.bz2
cowboy-c56bada509a448348ba724841a27abed201b4861.zip
Remove the error tuple return value for middlewares
It wasn't interesting compared to simply returning a halt tuple with an explicit reply.
Diffstat (limited to 'src/cowboy_protocol.erl')
-rw-r--r--src/cowboy_protocol.erl8
1 files changed, 2 insertions, 6 deletions
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.