eric6/Debugger/ExceptionLogger.py

branch
multi_processing
changeset 7379
72a72fd56494
parent 7360
9190402e4505
child 7564
787684e6f2f3
equal deleted inserted replaced
7377:cc920e534ac0 7379:72a72fd56494
85 if itm is None: 85 if itm is None:
86 self.backMenu.popup(coord) 86 self.backMenu.popup(coord)
87 else: 87 else:
88 self.menu.popup(coord) 88 self.menu.popup(coord)
89 89
90 def addException(self, exceptionType, exceptionMessage, stackTrace): 90 def addException(self, exceptionType, exceptionMessage, stackTrace,
91 debuggerId):
91 """ 92 """
92 Public slot to handle the arrival of a new exception. 93 Public slot to handle the arrival of a new exception.
93 94
94 @param exceptionType type of exception raised (string) 95 @param exceptionType type of exception raised
95 @param exceptionMessage message given by the exception (string) 96 @type str
96 @param stackTrace list of stack entries. 97 @param exceptionMessage message given by the exception
98 @type str
99 @param stackTrace list of stack entries
100 @type list
101 @param debuggerId ID of the debugger backend
102 @type str
97 """ 103 """
98 itm = QTreeWidgetItem(self) 104 itm = QTreeWidgetItem(self)
99 if exceptionType is None: 105 if exceptionType is None:
100 itm.setText( 106 itm.setText(
101 0, self.tr('An unhandled exception occured.' 107 0, self.tr('{0}: An unhandled exception occured.'
102 ' See the shell window for details.')) 108 ' See the shell window for details.')
109 .format(debuggerId))
103 return 110 return
104 111
105 if exceptionMessage == '': 112 if not exceptionMessage:
106 itm.setText(0, "{0}".format(exceptionType)) 113 itm.setText(0, self.tr("{0}: {1}").format(
114 debuggerId, exceptionType))
107 else: 115 else:
108 itm.setText(0, "{0}, {1}".format(exceptionType, exceptionMessage)) 116 itm.setText(0, self.tr("{0}: {1}, {2}").format(
117 debuggerId, exceptionType, exceptionMessage))
109 118
110 # now add the call stack, most recent call first 119 # now add the call stack, most recent call first
111 for entry in stackTrace: 120 for entry in stackTrace:
112 excitm = QTreeWidgetItem(itm) 121 excitm = QTreeWidgetItem(itm)
113 excitm.setText(0, "{0}, {1:d}".format(entry[0], entry[1])) 122 excitm.setText(0, "{0}, {1:d}".format(entry[0], entry[1]))

eric ide

mercurial