Commits

Anonymous committed 2ae9df3

manage reqstate in 404

  • Participants
  • Parent commits 1e7fdd7

Comments (0)

Files changed (1)

deps/webmachine/src/webmachine_decision_core.erl

 -export([do_log/1]).
 -include("webmachine_logger.hrl").
 
-
 handle_request(Resource, ReqState) ->
     put(resource, Resource),
     put(reqstate, ReqState),
 	404 ->
 	    {ok, ErrorHandler} = application:get_env(webmachine, error_handler),
 	    Reason = {none, none, []},
-	    ErrorHTML = ErrorHandler:render_error(
+	    {ErrorHTML,ReqState} = ErrorHandler:render_error(
                           Code, {webmachine_request,get(reqstate)}, Reason),
+            put(reqstate, ReqState),
             wrcall({set_resp_body, ErrorHTML});
         304 ->
             wrcall({remove_resp_header, "Content-Type"}),