Esempio n. 1
0
	def exception_handler(self, exc, environ):
		ErrorMiddleware.exception_handler(self, exc, environ)
		line = ''
		name = ''
		file = ''
		tb = exc[2]
		while tb is not None:
			if tb.tb_next is None:
				line = tb.tb_lineno
				co = tb.tb_frame.f_code
				file = co.co_filename
				name = co.co_name
			tb = tb.tb_next
		return '<pre>Exception %s in %s (%s line %s)</pre>' % (exc[1], name, os.path.basename(file), line)