0

catches all exceptions when loading a chunk image

This commit is contained in:
Andrew Brown
2010-09-27 01:03:39 -04:00
parent d637ddbbe1
commit c07ae135c1

View File

@@ -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)