anchor.diff:      send_chunk(Resp, []);
   
   send_chunked_error(Resp, Error) ->
  +    Stack = json_stack(Error),
  +    log_stack_trace(Stack),
       {Code, ErrorStr, ReasonStr} = error_info(Error),
       JsonError = {[{<<"code">>, Code},
           {<<"error">>,  ErrorStr},
  -        {<<"reason">>, ReasonStr} |
  -        case json_stack(Error) of [] -> []; Stack -> [{stack, Stack}] end
  +        {<<"reason">>, ReasonStr},
  +        {<<"ref">>, stack_hash(Stack)}
       ]},
       send_chunk(Resp, ?l2b([$\n,?JSON_ENCODE(JsonError),$\n])),
       send_chunk(Resp, []).
  
positive.code: send_error(Req, Code, ErrorStr, ReasonStr) ->
      send_error(Req, Code, [], ErrorStr, ReasonStr, []).
  
  send_error(Req, Code, Headers, ErrorStr, ReasonStr, Stack) ->
      send_json(Req, Code, Headers,
          {[{<<"error">>,  ErrorStr},
          {<<"reason">>, ReasonStr} |
          case Stack of [] -> []; _ -> [{stack, Stack}] end
      ]}).
  
  % give the option for list functions to output html or other raw errors
  
negative.code:                 {exit, normal, [{mochiweb_request, send, _} | _]} ->
                      exit(normal); % Client disconnect (R14)
                  _Else ->
                      send_error(HttpReq, {Error, nil, Stack})
              end
      end,
  