eric6/Debugger/ExceptionLogger.py

branch
maintenance
changeset 8043
0acf98cd089a
parent 7924
8a96736d465e
parent 7923
91e843545d9a
child 8176
31965986ecd1
equal deleted inserted replaced
7991:866adc8c315b 8043:0acf98cd089a
84 if itm is None: 84 if itm is None:
85 self.backMenu.popup(coord) 85 self.backMenu.popup(coord)
86 else: 86 else:
87 self.menu.popup(coord) 87 self.menu.popup(coord)
88 88
89 def addException(self, exceptionType, exceptionMessage, stackTrace): 89 def addException(self, exceptionType, exceptionMessage, stackTrace,
90 debuggerId):
90 """ 91 """
91 Public slot to handle the arrival of a new exception. 92 Public slot to handle the arrival of a new exception.
92 93
93 @param exceptionType type of exception raised (string) 94 @param exceptionType type of exception raised
94 @param exceptionMessage message given by the exception (string) 95 @type str
95 @param stackTrace list of stack entries. 96 @param exceptionMessage message given by the exception
97 @type str
98 @param stackTrace list of stack entries
99 @type list
100 @param debuggerId ID of the debugger backend
101 @type str
96 """ 102 """
97 itm = QTreeWidgetItem(self) 103 itm = QTreeWidgetItem(self)
98 if exceptionType is None: 104 if exceptionType is None:
99 itm.setText( 105 itm.setText(
100 0, self.tr('An unhandled exception occured.' 106 0, self.tr('{0}: An unhandled exception occured.'
101 ' See the shell window for details.')) 107 ' See the shell window for details.')
108 .format(debuggerId))
102 return 109 return
103 110
104 if exceptionMessage == '': 111 if not exceptionMessage:
105 text = "{0}".format(exceptionType) 112 text = self.tr("{0}: {1}").format(
113 debuggerId, exceptionType)
106 else: 114 else:
107 text = "{0}, {1}".format(exceptionType, exceptionMessage) 115 text = self.tr("{0}: {1}, {2}").format(
116 debuggerId, exceptionType, exceptionMessage)
108 117
109 itm.setText(0, text) 118 itm.setText(0, text)
110 itm.setToolTip(0, text) 119 itm.setToolTip(0, text)
111 120
112 # now add the call stack, most recent call first 121 # now add the call stack, most recent call first

eric ide

mercurial