anchor.diff:      {ok, Resp} = send_error(Req, Code, ErrorStr, ReasonStr),
       {ok, DelayedResp#delayed_resp{resp=Resp}};
   send_delayed_error(#delayed_resp{resp=Resp}, Reason) ->
  -    log_stack_trace(json_stack(Reason)),
  +    log_error_with_stack_trace(Reason),
       throw({http_abort, Resp, Reason}).
   
   end_delayed_json_response(#delayed_resp{}=DelayedResp) ->
  
positive.code:         throw({bad_ctype, [Else, " is not a supported content encoding."]})
      end.
  
  log_stack_trace(Stack) ->
      couch_log:error("~p failed with trace: ~p", [stack_hash(Stack), Stack]).
  
  stack_trace_id(Stack) ->
      {"X-Cloudant-Stack-Hash", stack_hash(Stack)}.
  
negative.code:         {[{<<"error">>,  ErrorStr},
          {<<"reason">>, ReasonStr}]});
  send_error(Req, Code, Headers, ErrorStr, ReasonStr, Stack) ->
      log_error_with_stack_trace({ErrorStr, ReasonStr, Stack}),
      send_json(Req, Code, [stack_trace_id(Stack) | Headers],
          {[{<<"error">>,  ErrorStr},
          {<<"reason">>, ReasonStr} |
          case Stack of [] -> []; _ -> [{<<"ref">>, stack_hash(Stack)}] end
      ]}).
  
  % give the option for list functions to output html or other raw errors
  