def HandleException(self):
		"""
		Fetch details about the last exception raised from the system, dispatch
		them to the log, and return a simplified summary string suitable for
		display in the user interface.

		@return (str, str) tuple: simplified summary of exception & detailed
			stack trace.
		"""
		self.trace()

		# get data
		(type, value, tb) = sys.exc_info()
		tb = traceback.format_exc()

		# dispatch message to exception logger
		logExc = '\n'
		logExc += '##########################################################\n'
		logExc += '### AN EXCEPTION OCCURRED:\n'
		logExc += '###\n'
		logExc += '\n### '.join( tb.splitlines() ) % '### %s\n'
		logExc += '###'
		logExc += '##########################################################'
		self.logger.Log(logExc)

		# return summary for UI display
		tb_last = traceback.format_exc().splitlines()
		tb_last = tb_last[len(tb_last)-3] # get 3rd line from bottom (last detail before error, code)
		return (
			"%s: %s. %s" % (type.__name__, str(value), str(tb_last)),
			logExc
		)

	###########################################################################
	## Private methods
	###########################################################################
dataset/ETHPy150Open Pathoschild/stewbot/stewbot/components/BaseClass.py/BaseClass.HandleException/swapped operands of `%`