@@ -36,28 +36,15 @@ def to_timestamp(value):
3636 return (value - epoch ).total_seconds ()
3737
3838
39- class EventHint (object ):
40- """Extra information for an event that can be used during processing."""
41-
42- def __init__ (self , exc_info = None ):
43- self .exc_info = exc_info
44-
45- @property
46- def exception (self ):
47- """Returns the exception value on the hint if there is one."""
48- if self .exc_info is not None :
49- return self .exc_info [1 ]
50-
51- @classmethod
52- def with_exc_info (cls , exc_info = None ):
53- """Creates a hint with the exc info filled in."""
54- if exc_info is None :
55- exc_info = sys .exc_info ()
56- else :
57- exc_info = exc_info_from_error (exc_info )
58- if exc_info [0 ] is None :
59- exc_info = None
60- return cls (exc_info = exc_info )
39+ def event_hint_with_exc_info (exc_info = None ):
40+ """Creates a hint with the exc info filled in."""
41+ if exc_info is None :
42+ exc_info = sys .exc_info ()
43+ else :
44+ exc_info = exc_info_from_error (exc_info )
45+ if exc_info [0 ] is None :
46+ exc_info = None
47+ return {"exc_info" : exc_info }
6148
6249
6350class BadDsn (ValueError ):
@@ -429,7 +416,7 @@ def exc_info_from_error(error):
429416
430417def event_from_exception (exc_info , with_locals = False , processors = None ):
431418 exc_info = exc_info_from_error (exc_info )
432- hint = EventHint . with_exc_info (exc_info )
419+ hint = event_hint_with_exc_info (exc_info )
433420 return (
434421 {
435422 "level" : "error" ,
0 commit comments