1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-12-13 11:32:20 -05:00

Added error logging for webserver gets and posts

This commit is contained in:
echel0n 2014-06-16 22:00:03 -07:00
parent 327df6682e
commit c09ceb5e6c

View File

@ -210,15 +210,23 @@ class IndexHandler(RedirectHandler):
@asynchronous
@gen.coroutine
def get(self, *args, **kwargs):
resp = yield self.get_response()
self.finish(resp)
try:
resp = yield self.get_response()
self.finish(resp)
except Exception as e:
logger.log(e, logger.ERROR)
self.finish()
@gen.coroutine
def get_response(self):
raise gen.Return(self._dispatch())
def post(self, *args, **kwargs):
self.finish(self._dispatch())
try:
self.finish(self._dispatch())
except Exception as e:
logger.log(e, logger.ERROR)
self.finish()
def robots_txt(self, *args, **kwargs):
""" Keep web crawlers out """