forked from SkyLined/BugId
-
Notifications
You must be signed in to change notification settings - Fork 1
/
cCdbTerminatedUnexpectedlyErrorReport.py
33 lines (32 loc) · 1.69 KB
/
cCdbTerminatedUnexpectedlyErrorReport.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
from mHTML import sHTMLDetailsTemplate, fsHTMLEncode;
class cCdbTerminatedUnexpectedlyErrorReport(object):
def __init__(oErrorReport, oCdbWrapper, uExitCode):
oErrorReport.sErrorTypeId = "CdbTerminated:%d" % uExitCode;
oErrorReport.sErrorDescription = "Cdb terminated unexpectedly";
oErrorReport.sSecurityImpact = None;
oErrorReport.oException = None;
oErrorReport.oStack = None;
oErrorReport.sStackId = None;
oErrorReport.sCodeId = None;
oErrorReport.sCodeDescription = None;
oErrorReport.atsAdditionalInformation = [];
oErrorReport.sProcessBinaryName = "cdb.exe";
oErrorReport.sId = oErrorReport.sErrorTypeId;
oErrorReport.sHTMLStack = None;
oErrorReport.sHTMLBinaryInformation = None;
# Turn cdb output into formatted HTML. It is separated into blocks, one for the initial cdb output and one for each
# command executed.
sHTMLCdbStdIO = '<hr class="StdIOSeparator"/>'.join(oCdbWrapper.asHTMLCdbStdIOBlocks);
del oCdbWrapper.asHTMLCdbStdIOBlocks;
# Create HTML details
oErrorReport.sHTMLDetails = sHTMLDetailsTemplate % {
"sId": fsHTMLEncode(oErrorReport.sId),
"sExceptionDescription": fsHTMLEncode(oErrorReport.sErrorDescription),
"sProcessBinaryName": fsHTMLEncode(oErrorReport.sProcessBinaryName),
"sCodeDescription": fsHTMLEncode(oErrorReport.sCodeDescription or "Unknown"),
"sSecurityImpact": oErrorReport.sSecurityImpact and \
'<span class="SecurityImpact">%s</span>' % fsHTMLEncode(oErrorReport.sSecurityImpact) or "None",
"sStack": oErrorReport.sHTMLStack or "Unknown",
"sBinaryInformation": oErrorReport.sHTMLBinaryInformation or "Unknown",
"sCdbStdIO": sHTMLCdbStdIO,
};