@@ -36,28 +36,15 @@ def to_timestamp(value):
36
36
return (value - epoch ).total_seconds ()
37
37
38
38
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 }
61
48
62
49
63
50
class BadDsn (ValueError ):
@@ -429,7 +416,7 @@ def exc_info_from_error(error):
429
416
430
417
def event_from_exception (exc_info , with_locals = False , processors = None ):
431
418
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 )
433
420
return (
434
421
{
435
422
"level" : "error" ,
0 commit comments