Skip to content

Commit

Permalink
Revert "format tracebacks with cause (#100)" (#102)
Browse files Browse the repository at this point in the history
This reverts commit 1c94520.
  • Loading branch information
dneuhaeuser-zalando authored Aug 28, 2020
1 parent 00751f9 commit 84e00eb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
8 changes: 2 additions & 6 deletions lightstep/recorder.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import warnings

from basictracer.recorder import SpanRecorder
from opentracing.logs import ERROR_KIND, STACK, ERROR_OBJECT
from opentracing.logs import ERROR_KIND, STACK

from lightstep.http_converter import HttpConverter
from lightstep.thrift_converter import ThriftConverter
Expand Down Expand Up @@ -171,11 +171,7 @@ def _normalize_log(self, log):
log.key_values[ERROR_KIND] = util._format_exc_type(log.key_values[ERROR_KIND])

if STACK in log.key_values:
log.key_values[STACK] = util._format_exc_tb(
log.key_values.get(ERROR_OBJECT),
log.key_values.get(ERROR_KIND),
log.key_values[STACK]
)
log.key_values[STACK] = util._format_exc_tb(log.key_values[STACK])

return log

Expand Down
4 changes: 2 additions & 2 deletions lightstep/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ def _coerce_to_unicode(val):
return '(encoding error)'


def _format_exc_tb(exc_value, exc_type, exc_tb):
def _format_exc_tb(exc_tb):
if type(exc_tb) is types.TracebackType:
return ''.join(traceback.format_exception(exc_value, exc_type, exc_tb))
return ''.join(traceback.format_tb(exc_tb))

return exc_tb

Expand Down

0 comments on commit 84e00eb

Please sign in to comment.