Commits

Anonymous committed 3fb1140

don't unwrap resource error - it will cause a bad_match in decision core

  • Participants
  • Parent commits f6da877

Comments (0)

Files changed (1)

src/webmachine_resource.erl

     end.
 
 do(Fun, ReqProps) when is_atom(Fun) andalso is_list(ReqProps) ->
-    Self = proplists:get_value(resource, ReqProps),
     RState0 = proplists:get_value(reqstate, ReqProps),
     put(tmp_reqstate, empty),
     {Reply, ReqData, NewModState} = handle_wm_call(Fun, 
                     (RState0#reqstate.reqdata)#wm_reqdata{wm_state=RState0}),
-    case Reply of
-        {error, Err} -> {Err, Self};
-        _ ->
-            ReqState = case get(tmp_reqstate) of
-                empty -> RState0;
-                X -> X
-            end,
-            {Reply,
-            webmachine_resource:new(R_Mod, NewModState, R_ModExports, R_Trace),
-            ReqState#reqstate{reqdata=ReqData}}
-    end.
+    ReqState = case get(tmp_reqstate) of
+                   empty -> RState0;
+                   X -> X
+               end,
+    {Reply,
+     webmachine_resource:new(R_Mod, NewModState, R_ModExports, R_Trace),
+     ReqState#reqstate{reqdata=ReqData}}.
 
 handle_wm_call(Fun, ReqData) ->
     case default(Fun) of