anchor.diff:                       State#base_state{log_msg = LogMsg}};
                   Why ->
                       State1 = State#base_state{log_msg = Why},
  +                    % TODO - parse sql error to get minimal meaningful message,
  +                    % without exposing sensitive data
                       {{halt, 500}, Req, State1}
               end
       end.
  
positive.code:             case chef_db:update(ObjectRec, DbContext, ActorId) of
                  ok ->
                      IsRename = chef_object:name(OrigObjectRec) =/= chef_object:name(ObjectRec),
                      Req1 = handle_rename(ObjectRec, Req, IsRename),
                      {true, chef_wm_util:set_json_body(Req1, ObjectEjson), State};
                  not_found ->
                      %% We will get this if no rows were affected by the query. This could
  
negative.code: %% When we rename an object, we want to return 201 because the location of the object
  %% has now changed. Setting the location header here to correspond to the new name
  %% will force webmachine to return 201.
  handle_rename(_ObjectRec, Req, _State, false) ->
      Req;
  handle_rename(ObjectRec, Req, #base_state{resource_mod = ResourceMod} = State, true) ->
      {TypeName, Args} = call_if_exported(ResourceMod, route_args,
                                          [ObjectRec, State], fun route_args/2),
      Uri = oc_chef_wm_routes:route(TypeName, Req, Args),
      wrq:set_resp_header("Location", binary_to_list(Uri), Req).
  
  %%% @doc Return appropriate public key based on request source
  