From c07ae135c1968d236c90115e1a13402358fea628 Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Mon, 27 Sep 2010 01:03:39 -0400 Subject: [PATCH] catches all exceptions when loading a chunk image --- quadtree.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/quadtree.py b/quadtree.py index 0e02221..a075e77 100644 --- a/quadtree.py +++ b/quadtree.py @@ -539,13 +539,14 @@ def render_worldtile(chunks, colstart, colend, rowstart, rowend, path): try: chunkimg = Image.open(chunkfile) chunkimg.load() - except IOError, e: + except Exception, e: # If for some reason the chunk failed to load (perhaps a previous # run was canceled and the file was only written half way, # corrupting it), then this could error. # Since we have no easy way of determining how this chunk was # generated, we need to just ignore it. print "Error opening file", chunkfile + print "(Error was {0})".format(e) try: # Remove the file so that the next run will re-generate it. os.unlink(chunkfile)