Details
Description
I'm reading utf-8 documents from disk and embedding them in a json structure. Several of them contain invalid utf-8 characters. If I PUT to couchdb I get a stack trace in my debug log and the tcp connection is dropped--no http code is returned
[Wed, 08 Feb 2012 17:58:55 GMT] [error] [<0.28906.4>] {error_report,<0.31.0>,
{<0.28906.4>,crash_report,
[[{initial_call,
{mochiweb_acceptor,init,
['Argument__1','Argument__2','Argument__3']}},
,
,
{error_info,
{exit,
{ucs,{bad_utf8_character_code}},
[{xmerl_ucs,from_utf8,1,
[
,
{line,185}]},
{mochijson2,json_encode_string,2,
[
{mochijson2,'
[{file,"mochijson2.erl"}
,
{line,129}]},
{lists,foldl,3,[
,
{line,1197}]},
{mochijson2,json_encode_proplist,2,
[
,
{line,132}]},
{couch_httpd,send_json,4,
[
{couch_httpd,handle_request_int,5,
[{file,"couch_httpd.erl"}
,
{line,272}]},
{mochiweb_http,headers,5,
[
,
{line,126}]}]}},
,
,
,
{dictionary,
[{mochiweb_request_body,
<<"
\n">>},
,
,
,
]},
,
,
,
,
],
[]]}}