PUTing JSON with invalid UTF-8 returns no error message
--------------------------------------------------------
Key: COUCHDB-1406
URL: https://issues.apache.org/jira/browse/COUCHDB-1406
Project: CouchDB
Issue Type: Bug
Components: HTTP Interface
Affects Versions: 1.1.1
Environment: Debian testing
Reporter: Sam Vevang
Priority: Minor
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']}},
{pid,<0.28906.4>},
{registered_name,[]},
{error_info,
{exit,
{ucs,{bad_utf8_character_code}},
[{xmerl_ucs,from_utf8,1,
[{file,"xmerl_ucs.erl"},{line,185}]},
{mochijson2,json_encode_string,2,
[{file,"mochijson2.erl"},{line,148}]},
{mochijson2,'-json_encode_proplist/2-fun-0-',3,
[{file,"mochijson2.erl"},{line,129}]},
{lists,foldl,3,[{file,"lists.erl"},{line,1197}]},
{mochijson2,json_encode_proplist,2,
[{file,"mochijson2.erl"},{line,132}]},
{couch_httpd,send_json,4,
[{file,"couch_httpd.erl"},{line,635}]},
{couch_httpd,handle_request_int,5,
[{file,"couch_httpd.erl"},{line,272}]},
{mochiweb_http,headers,5,
[{file,"mochiweb_http.erl"},{line,126}]}]}},
{ancestors,
[couch_httpd,couch_secondary_services,
couch_server_sup,<0.32.0>]},
{messages,[]},
{links,[<0.113.0>,#Port<0.30990>]},
{dictionary,
[{mochiweb_request_body,
<<"{\"id\":111,\"doc\":\"ker\\u0019 u\"}\n">>},
{mochiweb_request_qs,[]},
{mochiweb_request_recv,true},
{jsonp,no_jsonp},
{mochiweb_request_cookie,[]}]},
{trap_exit,false},
{status,running},
{heap_size,2584},
{stack_size,24},
{reductions,7048}],
[]]}}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira