File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import traceback
2+ import sys
3+
14from stackify .formats import JSONObject
25
36
@@ -11,12 +14,17 @@ def __init__(self):
1114 self .StackTrace = [] # array of TraceFrames
1215 self .InnerError = None # cause?
1316
17+ def load_stack (self , tb ):
18+ stacks = traceback .extract_tb (tb )
19+ for filename , lineno , parent , method in stacks :
20+ self .StackTrace .append (TraceFrame (filename , lineno , method ))
21+
1422
1523class TraceFrame (JSONObject ):
16- def __init__ (self ):
17- self .CodeFileName = None
18- self .LineNum = None
19- self .Method = None
24+ def __init__ (self , filename , lineno , method ):
25+ self .CodeFileName = filename
26+ self .LineNum = lineno
27+ self .Method = method
2028
2129
2230class WebRequestDetail (JSONObject ):
@@ -47,3 +55,8 @@ def __init__(self):
4755 self .CustomerName = None
4856 self .UserName = None
4957
58+ def load_exception (self ):
59+ self .Error = ErrorItem ()
60+ type_ , value , tb = sys .exc_info ()
61+ self .Error .load_stack (tb )
62+
You can’t perform that action at this time.
0 commit comments