Skip to content
This repository was archived by the owner on Jun 13, 2023. It is now read-only.

Commit b185c82

Browse files
authored
fix(trace.py): print epsagon exceptions on debug (#320)
1 parent 509a181 commit b185c82

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

epsagon/modules/tornado.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,11 +260,13 @@ def _wrapper(wrapped, instance, args, kwargs):
260260
:param kwargs: wrapt's kwargs
261261
:return: None
262262
"""
263+
print_debug('AsyncHTTPClient init')
263264
try:
264265
request, raise_error = _prepare_http_request(*args, **kwargs)
265266
except Exception: # pylint: disable=W0703
266267
return wrapped(*args, **kwargs)
267268

269+
print_debug('AsyncHTTPClient setting header')
268270
trace_header = get_epsagon_http_trace_id()
269271

270272
if isinstance(request.headers, HTTPHeaders):
@@ -274,6 +276,7 @@ def _wrapper(wrapped, instance, args, kwargs):
274276
if EPSAGON_HEADER not in request.headers:
275277
request.headers[EPSAGON_HEADER] = trace_header
276278

279+
print_debug('AsyncHTTPClient running wrapper')
277280
return wrapper(
278281
TornadoClientEventFactory,
279282
wrapped,

epsagon/trace.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,11 @@ def add_exception(self, exception, stack_trace, additional_data=''):
472472
additional data regarding the exception
473473
:return: None
474474
"""
475+
if self.debug:
476+
print('[EPSAGON_DEBUG] Epsagon exception: {}\n{}-----'.format(
477+
exception,
478+
stack_trace
479+
))
475480
if self.get_trace():
476481
self.get_trace().add_exception(
477482
exception,

0 commit comments

Comments
 (0)