diff options
author | Klaus Fl <kfleerko@thoughtworks.com> | 2015-08-07 17:19:25 +0200 |
---|---|---|
committer | Folker Bernitt <fbernitt@thoughtworks.com> | 2015-08-11 17:00:33 +0200 |
commit | 319e5e2ddd20444bb30f294a2fd08854dfaae494 (patch) | |
tree | 1d341aca9bb601170414275f0cc90b3e19b22359 /service/pixelated/resources | |
parent | 8585a186716a4f45132e3c9eea90a792ca76c2a2 (diff) |
Make indexing recepients work again by fixing serialization bug
Diffstat (limited to 'service/pixelated/resources')
-rw-r--r-- | service/pixelated/resources/contacts_resource.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/service/pixelated/resources/contacts_resource.py b/service/pixelated/resources/contacts_resource.py index 5ec39761..c9b81f54 100644 --- a/service/pixelated/resources/contacts_resource.py +++ b/service/pixelated/resources/contacts_resource.py @@ -29,8 +29,16 @@ class ContactsResource(Resource): self._search_engine = search_engine def render_GET(self, request): - query = request.args.get('q', [''])[0] + query = request.args.get('q', ['']) d = deferToThread(lambda: self._search_engine.contacts(query)) d.addCallback(lambda tags: respond_json_deferred(tags, request)) + def handle_error(error): + print 'Something went wrong' + import traceback + traceback.print_exc() + print error + + d.addErrback(handle_error) + return server.NOT_DONE_YET |