anchor.diff:  			next(Req2, State#state{handler_state=HandlerState}, OnFalse)
   	end.
   
  -call(Req, #state{handler=Handler, handler_state=HandlerState}, Fun) ->
  -	case erlang:function_exported(Handler, Fun, 2) of
  -		true -> Handler:Fun(Req, HandlerState);
  +call(Req, State=#state{handler=Handler, handler_state=HandlerState},
  +		Callback) ->
  +	case erlang:function_exported(Handler, Callback, 2) of
  +		true ->
  +			try
  +				Handler:Callback(Req, HandlerState)
  +			catch Class:Reason ->
  +				error_logger:error_msg(
  +					"** Cowboy handler ~p terminating in ~p/~p~n"
  +					"   for the reason ~p:~p~n** Handler state was ~p~n"
  +					"** Request was ~p~n** Stacktrace: ~p~n~n",
  +					[Handler, Callback, 2, Class, Reason, HandlerState,
  +						cowboy_req:to_list(Req), erlang:get_stacktrace()]),
  +				error_terminate(Req, State)
  +			end;
  +		false ->
  +			no_call
  +	end.
  +
  +unsafe_call(Req, #state{handler=Handler, handler_state=HandlerState},
  +		Callback) ->
  +	case erlang:function_exported(Handler, Callback, 2) of
  +		true -> Handler:Callback(Req, HandlerState);
   		false -> no_call
   	end.
   
  
positive.code: expires(Req, State=#state{expires=no_call}) ->
  	{undefined, Req, State};
  expires(Req, State=#state{expires=undefined}) ->
  	case call(Req, State, expires) of
  		no_call ->
  			{undefined, Req, State#state{expires=no_call}};
  		{Expires, Req2, HandlerState} ->
  
negative.code: 		Method = cowboy_req:get(method, Req),
  		case erlang:function_exported(Handler, rest_init, 2) of
  			true ->
  				try Handler:rest_init(Req, HandlerOpts) of
  					{ok, Req2, HandlerState} ->
  						service_available(Req2, #state{env=Env, method=Method,
  							handler=Handler, handler_state=HandlerState})
  				catch Class:Reason ->
  					error_logger:error_msg(
  						"** Cowboy handler ~p terminating in ~p/~p~n"
  						"   for the reason ~p:~p~n** Options were ~p~n"
  						"** Request was ~p~n** Stacktrace: ~p~n~n",
  						[Handler, rest_init, 2, Class, Reason, HandlerOpts,
  							cowboy_req:to_list(Req), erlang:get_stacktrace()]),
  					{error, 500, Req}
  				end;
  			false ->
  				service_available(Req, #state{env=Env, method=Method,
  					handler=Handler})
  		end
  	catch
  		throw:{?MODULE, error} ->
  			{error, 500, Req}
  	end.
  
  service_available(Req, State) ->
  