summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-06-05 02:56:25 +0200
committerhut <hut@lavabit.com>2010-06-05 02:56:25 +0200
commit2749081931a2c86cac2b8e37920006843f06e246 (patch)
tree9f4f2629beb33489e48680a5f9143305976129f8
parent6bd1c59255793f2ca565c992809c32129111f71a (diff)
downloadranger-2749081931a2c86cac2b8e37920006843f06e246.tar.gz
main: fixed error handling in python2.6 and improved it
-rw-r--r--ranger/__main__.py22
1 files changed, 8 insertions, 14 deletions
diff --git a/ranger/__main__.py b/ranger/__main__.py
index 5f525582..64ad4b74 100644
--- a/ranger/__main__.py
+++ b/ranger/__main__.py
@@ -191,7 +191,7 @@ def main():
 	else:
 		path = '.'
 
-	crash_exception = None
+	crash_traceback = None
 	try:
 		# Initialize objects
 		EnvironmentAware._assign(Environment(path))
@@ -205,24 +205,18 @@ def main():
 		fm.ui.initialize()
 		fm.loop()
 	except Exception as e:
-		crash_exception = e
-		if not (arg.debug or arg.clean):
-			import traceback
-			dumpname = ranger.relpath_conf('traceback')
-			traceback.print_exc(file=open(dumpname, 'w'))
+		import traceback
+		crash_traceback = traceback.format_exc()
 	finally:
-		# Finish, clean up
 		try:
 			fm.ui.destroy()
 		except (AttributeError, NameError):
 			pass
-		if crash_exception:
-			print("Fatal: " + str(crash_exception))
-			if arg.debug or arg.clean:
-				raise crash_exception
-			else:
-				print("A traceback has been saved to " + dumpname)
-				print("Please include it in a bugreport.")
+		if crash_traceback:
+			print(crash_traceback)
+			print("Ranger crashed.  " \
+					"Please report it (including the traceback) at:")
+			print("http://savannah.nongnu.org/bugs/?group=ranger&func=additem")
 
 
 if __name__ == '__main__':