Commit e7ecc50a authored by Jogi Hofmüller's avatar Jogi Hofmüller

Handle key error

parent f73c3e5f
......@@ -110,8 +110,12 @@ class GeruechtHandler(RestHandler):
else:
data = {'status': 'success', 'payload': geruecht}
# here we will display the client's ip address
logmsg('GeruechtHandler: served geruecht to remote_ip={}, referer={}, origin={}'.format(
self.request.remote_ip, self.request.headers['Referer'], self.request.headers['Origin']))
try:
logmsg('GeruechtHandler: served geruecht to remote_ip={}, referer={}, origin={}'.format(
self.request.remote_ip, self.request.headers['Referer'], self.request.headers['Origin']))
except KeyError:
logmsg('GeruechtHandler: served geruecht to remote_ip={}'.format(
self.request.remote_ip))
data = json.dumps(data)
self.finish(data)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment