From: Ben Darnell Date: Mon, 23 Dec 2013 22:33:46 +0000 (-0500) Subject: Improve log message for invalid unicode. X-Git-Tag: v3.2.0b1~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=893c30d2dc8a16bea53e683f4903b83879b9d08f;p=thirdparty%2Ftornado.git Improve log message for invalid unicode. Truncate long values, and include the argument name if available. --- diff --git a/tornado/web.py b/tornado/web.py index 915ddb9d9..2f7e92ea0 100644 --- a/tornado/web.py +++ b/tornado/web.py @@ -450,7 +450,8 @@ class RequestHandler(object): try: return _unicode(value) except UnicodeDecodeError: - raise HTTPError(400, "Invalid unicode: %r" % value) + raise HTTPError(400, "Invalid unicode in %s: %r" % + (name or "url", value[:40])) @property def cookies(self):