catches all exceptions when loading a chunk image
This commit is contained in:
@@ -539,13 +539,14 @@ def render_worldtile(chunks, colstart, colend, rowstart, rowend, path):
|
|||||||
try:
|
try:
|
||||||
chunkimg = Image.open(chunkfile)
|
chunkimg = Image.open(chunkfile)
|
||||||
chunkimg.load()
|
chunkimg.load()
|
||||||
except IOError, e:
|
except Exception, e:
|
||||||
# If for some reason the chunk failed to load (perhaps a previous
|
# If for some reason the chunk failed to load (perhaps a previous
|
||||||
# run was canceled and the file was only written half way,
|
# run was canceled and the file was only written half way,
|
||||||
# corrupting it), then this could error.
|
# corrupting it), then this could error.
|
||||||
# Since we have no easy way of determining how this chunk was
|
# Since we have no easy way of determining how this chunk was
|
||||||
# generated, we need to just ignore it.
|
# generated, we need to just ignore it.
|
||||||
print "Error opening file", chunkfile
|
print "Error opening file", chunkfile
|
||||||
|
print "(Error was {0})".format(e)
|
||||||
try:
|
try:
|
||||||
# Remove the file so that the next run will re-generate it.
|
# Remove the file so that the next run will re-generate it.
|
||||||
os.unlink(chunkfile)
|
os.unlink(chunkfile)
|
||||||
|
|||||||
Reference in New Issue
Block a user