@@ -22,6 +22,7 @@ def journalGetExceptions(journal):
22
22
excobjs = []
23
23
for line in exclines :
24
24
newexc = RecordedException (line )
25
+ addnewexc = True
25
26
if line .Type == "JournalTimeStamp" :
26
27
lp1 = line .Description .split ("ApplicationException is being thrown on behalf of the function <" ,1 )
27
28
if len (lp1 ) > 1 :
@@ -34,20 +35,29 @@ def journalGetExceptions(journal):
34
35
elif line .Description .startswith ("ExceptionCode" ): newexc .Type = "Fatal Error"
35
36
newexc .Message = line .Description
36
37
elif line .Type == "JournalAPIMessage" :
37
- lp1 = line .MessageText .split (" exception(" ,1 )
38
- newexc .Type = lp1 [0 ]
39
- if len (lp1 ) > 1 :
40
- lp2 = lp1 [1 ].split (") was thrown from a handler of " ,1 )
41
- newexc .Message = lp2 [0 ]
42
- if len (lp2 ) > 1 :
43
- lp3 = lp2 [1 ].split ("event. The API event handler was registered by application " ,1 )
44
- newexc .Event = lp3 [0 ]
45
- if len (lp3 ) > 1 :
46
- lp4 = lp3 [1 ].split (" (" ,1 )
47
- newexc .AppName = lp4 [0 ]
48
- if len (lp4 ) > 1 :
49
- lp5 = lp4 [1 ].split (")" ,1 )
50
- newexc .AppGUID = lp5 [0 ]
38
+ if line .MessageText .startswith ("An external service execution throws" ):
39
+ addnewexc = False
40
+ lp1 = line .MessageText .split (":" )
41
+ excobjs [- 1 ].Message = excobjs [- 1 ].Message + " " + lp1 [0 ]
42
+ if len (lp1 ) > 1 :
43
+ lp2 = lp1 [1 ].split ("; " )
44
+ excobjs [- 1 ].AppName = lp2 [0 ].replace (" Name(" ,"" ).replace (")" ,"" )
45
+ if len (lp2 ) > 3 : excobjs [- 1 ].AppGUID = lp2 [2 ] + ", " + lp2 [3 ]
46
+ else :
47
+ lp1 = line .MessageText .split (" exception(" ,1 )
48
+ newexc .Type = lp1 [0 ]
49
+ if len (lp1 ) > 1 :
50
+ lp2 = lp1 [1 ].split (") was thrown from a handler of " ,1 )
51
+ newexc .Message = lp2 [0 ]
52
+ if len (lp2 ) > 1 :
53
+ lp3 = lp2 [1 ].split ("event. The API event handler was registered by application " ,1 )
54
+ newexc .Event = lp3 [0 ]
55
+ if len (lp3 ) > 1 :
56
+ lp4 = lp3 [1 ].split (" (" ,1 )
57
+ newexc .AppName = lp4 [0 ]
58
+ if len (lp4 ) > 1 :
59
+ lp5 = lp4 [1 ].split (")" ,1 )
60
+ newexc .AppGUID = lp5 [0 ]
51
61
elif line .Type == "JournalComment" :
52
62
lp1 = line .RawText .split ("Exception caught from managed method " ,1 )
53
63
if len (lp1 ) > 1 :
@@ -59,13 +69,19 @@ def journalGetExceptions(journal):
59
69
if len (lp3 ) > 1 : newexc .Message = lp3 [1 ].strip ()[:- 1 ]
60
70
else :
61
71
lp1 = line .RawText .split ("External Command Registration Exception: " ,1 )
72
+ lp2 = line .RawText .split (":< " )
62
73
if len (lp1 ) > 1 :
63
74
newexc .Type = "External Command Registration Exception"
64
75
newexc .Message = lp1 [1 ]
65
76
elif "OpenStream FileException" in line .RawText : newexc .Type = "OpenStream FileException"
77
+ elif "exceptionsInOnOpenDocument" in line .RawText :
78
+ addnewexc = False
79
+ lp3 = line .RawText .split ("<<" )
80
+ if len (lp3 ) > 1 : excobjs [- 1 ].Message = excobjs [- 1 ].Message + " " + lp3 [1 ]
81
+ elif len (lp2 ) > 1 : newexc .Message = lp2 [1 ]
66
82
else : newexc .Message = line .RawText
67
83
else : newexc .Message = line .RawText
68
- excobjs .append (newexc )
84
+ if addnewexc : excobjs .append (newexc )
69
85
return excobjs
70
86
else : return []
71
87
0 commit comments