diff options
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 |