add error handler for dbapi. when there is an exception in the db
layer, this handler gets called instead of after_execute.
This commit is contained in:
parent
6a8b5d59e7
commit
41de145487
@ -132,7 +132,14 @@ def after_execute(name):
|
||||
if not config.db_tracing_enabled:
|
||||
return
|
||||
stop('execute')
|
||||
pass
|
||||
return handler
|
||||
|
||||
def dbapi_error(name):
|
||||
def handler(conn, cursor, statement, parameters, context, exception):
|
||||
if not config.db_tracing_enabled:
|
||||
return
|
||||
annotate('database exception {0}'.format(exception))
|
||||
stop('execute')
|
||||
return handler
|
||||
|
||||
## http helpers
|
||||
|
Loading…
x
Reference in New Issue
Block a user