From 9f78585f624d154579cb648d6e7b6298e994fee9 Mon Sep 17 00:00:00 2001 From: John Christopher Anderson Date: Fri, 13 Aug 2010 23:52:24 +0000 Subject: more informative error messages on invalid json git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@985407 13f79535-47bb-0310-9956-ffa450edef68 --- src/couchdb/couch_httpd.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/couchdb/couch_httpd.erl b/src/couchdb/couch_httpd.erl index 0aa77c16..448cd432 100644 --- a/src/couchdb/couch_httpd.erl +++ b/src/couchdb/couch_httpd.erl @@ -289,7 +289,7 @@ handle_request_int(MochiReq, DefaultFun, throw:{invalid_json, S} -> ?LOG_ERROR("attempted upload of invalid JSON (set log_level to debug to log it)", []), ?LOG_DEBUG("Invalid JSON: ~p",[S]), - send_error(HttpReq, {bad_request, "invalid UTF-8 JSON"}); + send_error(HttpReq, {bad_request, io_lib:format("invalid UTF-8 JSON: ~p",[S])}); throw:unacceptable_encoding -> ?LOG_ERROR("unsupported encoding method for the response", []), send_error(HttpReq, {not_acceptable, "unsupported encoding"}); -- cgit v1.2.3