.BANCHO. Add tornado-sentry capture decorators

This commit is contained in:
Nyo 2016-12-28 12:41:24 +01:00
parent 22ae4c332b
commit 18a7c47db6
8 changed files with 45 additions and 9 deletions

2
common

@ -1 +1 @@
Subproject commit 741dde1ace3e5615d0e1d98cbeb41e07da7fb02b Subproject commit 6329b9ac2dac305f90b09bc3fa761ced2b4f03d0

View File

@ -1,6 +1,9 @@
import json import json
from common.log import logUtils as log import tornado.web
import tornado.gen
from common.sentry import sentry
from common.web import requestsManager from common.web import requestsManager
from constants import exceptions from constants import exceptions
from helpers import chatHelper from helpers import chatHelper
@ -8,6 +11,9 @@ from objects import glob
class handler(requestsManager.asyncRequestHandler): class handler(requestsManager.asyncRequestHandler):
@tornado.web.asynchronous
@tornado.gen.engine
@sentry.captureTornado
def asyncGet(self): def asyncGet(self):
statusCode = 400 statusCode = 400
data = {"message": "unknown error"} data = {"message": "unknown error"}

View File

@ -1,5 +1,9 @@
import json import json
import tornado.web
import tornado.gen
from common.sentry import sentry
from common.ripple import userUtils from common.ripple import userUtils
from common.web import requestsManager from common.web import requestsManager
from constants import exceptions from constants import exceptions
@ -7,6 +11,9 @@ from objects import glob
class handler(requestsManager.asyncRequestHandler): class handler(requestsManager.asyncRequestHandler):
@tornado.web.asynchronous
@tornado.gen.engine
@sentry.captureTornado
def asyncGet(self): def asyncGet(self):
statusCode = 400 statusCode = 400
data = {"message": "unknown error"} data = {"message": "unknown error"}

View File

@ -1,10 +1,17 @@
import json import json
import tornado.web
import tornado.gen
from common.sentry import sentry
from common.web import requestsManager from common.web import requestsManager
from objects import glob from objects import glob
class handler(requestsManager.asyncRequestHandler): class handler(requestsManager.asyncRequestHandler):
@tornado.web.asynchronous
@tornado.gen.engine
@sentry.captureTornado
def asyncGet(self): def asyncGet(self):
statusCode = 400 statusCode = 400
data = {"message": "unknown error"} data = {"message": "unknown error"}

View File

@ -1,10 +1,17 @@
import json import json
import tornado.web
import tornado.gen
from common.sentry import sentry
from common.web import requestsManager from common.web import requestsManager
from objects import glob from objects import glob
class handler(requestsManager.asyncRequestHandler): class handler(requestsManager.asyncRequestHandler):
@tornado.web.asynchronous
@tornado.gen.engine
@sentry.captureTornado
def asyncGet(self): def asyncGet(self):
statusCode = 400 statusCode = 400
data = {"message": "unknown error"} data = {"message": "unknown error"}

View File

@ -1,11 +1,18 @@
import json import json
import tornado.web
import tornado.gen
from common.sentry import sentry
from common.web import requestsManager from common.web import requestsManager
from constants import exceptions from constants import exceptions
from objects import glob from objects import glob
class handler(requestsManager.asyncRequestHandler): class handler(requestsManager.asyncRequestHandler):
@tornado.web.asynchronous
@tornado.gen.engine
@sentry.captureTornado
def asyncGet(self): def asyncGet(self):
statusCode = 400 statusCode = 400
data = {"message": "unknown error"} data = {"message": "unknown error"}

View File

@ -1,5 +1,9 @@
import json import json
import tornado.web
import tornado.gen
from common.sentry import sentry
from common.log import logUtils as log from common.log import logUtils as log
from common.web import requestsManager from common.web import requestsManager
from constants import exceptions from constants import exceptions
@ -8,6 +12,9 @@ from objects import glob
class handler(requestsManager.asyncRequestHandler): class handler(requestsManager.asyncRequestHandler):
@tornado.web.asynchronous
@tornado.gen.engine
@sentry.captureTornado
def asyncGet(self): def asyncGet(self):
statusCode = 400 statusCode = 400
data = {"message": "unknown error"} data = {"message": "unknown error"}

View File

@ -56,13 +56,14 @@ from events import tournamentJoinMatchChannelEvent
from events import tournamentLeaveMatchChannelEvent from events import tournamentLeaveMatchChannelEvent
from helpers import packetHelper from helpers import packetHelper
from objects import glob from objects import glob
from common.sentry import sentry
class handler(requestsManager.asyncRequestHandler): class handler(requestsManager.asyncRequestHandler):
@tornado.web.asynchronous @tornado.web.asynchronous
@tornado.gen.engine @tornado.gen.engine
@sentry.captureTornado
def asyncPost(self): def asyncPost(self):
#try:
# Track time if needed # Track time if needed
if glob.outputRequestTime: if glob.outputRequestTime:
# Start time # Start time
@ -238,12 +239,6 @@ class handler(requestsManager.asyncRequestHandler):
self.add_header("Connection", "keep-alive") self.add_header("Connection", "keep-alive")
self.add_header("Keep-Alive", "timeout=5, max=100") self.add_header("Keep-Alive", "timeout=5, max=100")
self.add_header("Content-Type", "text/html; charset=UTF-8") self.add_header("Content-Type", "text/html; charset=UTF-8")
#except:
# log.error("Unknown error!\n```\n{}\n{}```".format(sys.exc_info(), traceback.format_exc()))
# if glob.sentry:
# yield tornado.gen.Task(self.captureException, exc_info=True)
#finally:
# self.finish()
@tornado.web.asynchronous @tornado.web.asynchronous
@tornado.gen.engine @tornado.gen.engine