Skip to content

Commit

Permalink
log message in exception level when path encoding errors happen.
Browse files Browse the repository at this point in the history
Original code is kind of except-pass. This will ignore the error
occurs in process of encoding path. And if such error happened
without any information in logs, developer have to debug in a
long distance from error stack. That's wasting time, so there
should be a logging message here.

Fixes: bug #1123048
Change-Id: I7941b524e936241fb8d62fad5ad90de3daffe5e7
  • Loading branch information
pyKun committed Feb 13, 2013
1 parent af3bd46 commit f4a09eb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions swift/common/bufferedhttp.py
Expand Up @@ -129,8 +129,8 @@ def http_connect(ipaddr, port, device, partition, method, path,
if isinstance(path, unicode):
try:
path = path.encode("utf-8")
except UnicodeError:
pass # what should I do?
except UnicodeError, e:
logging.exception(_('Error encoding to UTF-8: %s'), e.message)
path = quote('/' + device + '/' + str(partition) + path)
return http_connect_raw(
ipaddr, port, method, path, headers, query_string, ssl)
Expand Down

0 comments on commit f4a09eb

Please sign in to comment.