Added better error related log lines for corrupt chunks
This commit is contained in:
@@ -942,7 +942,7 @@ class TileSet(object):
|
|||||||
except nbt.CorruptionError:
|
except nbt.CorruptionError:
|
||||||
# A warning and traceback was already printed by world.py's
|
# A warning and traceback was already printed by world.py's
|
||||||
# get_chunk()
|
# get_chunk()
|
||||||
logging.debug("Skipping corrupt chunk at %s,%s", chunkx, chunkz)
|
logging.debug("Skipping the render of corrupt chunk at %s,%s and moving on.", chunkx, chunkz)
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
logging.warning("Could not render chunk %s,%s for some reason. I'm going to ignore this and continue", chunkx, chunkz)
|
logging.warning("Could not render chunk %s,%s for some reason. I'm going to ignore this and continue", chunkx, chunkz)
|
||||||
logging.debug("Full error was:", exc_info=1)
|
logging.debug("Full error was:", exc_info=1)
|
||||||
|
|||||||
@@ -289,7 +289,7 @@ class RegionSet(object):
|
|||||||
self.regioncache[regionfilename] = region
|
self.regioncache[regionfilename] = region
|
||||||
return region
|
return region
|
||||||
|
|
||||||
@log_other_exceptions
|
#@log_other_exceptions
|
||||||
def get_chunk(self, x, z):
|
def get_chunk(self, x, z):
|
||||||
"""Returns a dictionary object representing the "Level" NBT Compound
|
"""Returns a dictionary object representing the "Level" NBT Compound
|
||||||
structure for a chunk given its x, z coordinates. The coordinates given
|
structure for a chunk given its x, z coordinates. The coordinates given
|
||||||
@@ -333,13 +333,20 @@ class RegionSet(object):
|
|||||||
# Flush the region cache to possibly read a new region file
|
# Flush the region cache to possibly read a new region file
|
||||||
# header
|
# header
|
||||||
logging.debug("Encountered a corrupt chunk at %s,%s. Flushing cache and retrying", x, z)
|
logging.debug("Encountered a corrupt chunk at %s,%s. Flushing cache and retrying", x, z)
|
||||||
logging.debug("Error was:", exc_info=1)
|
#logging.debug("Error was:", exc_info=1)
|
||||||
del self.regioncache[regionfile]
|
del self.regioncache[regionfile]
|
||||||
time.sleep(0.5)
|
time.sleep(0.5)
|
||||||
continue
|
continue
|
||||||
else:
|
else:
|
||||||
logging.warning("Tried several times to read chunk %d,%d. Giving up.",
|
if isinstance(e, nbt.CorruptRegionError):
|
||||||
x, z, e)
|
logging.warning("Tried several times to read chunk %d,%d. Its region (%d,%d) may be corrupt. Giving up.",
|
||||||
|
x, z,x//32,z//32)
|
||||||
|
elif isinstance(e, nbt.CorruptChunkError):
|
||||||
|
logging.warning("Tried several times to read chunk %d,%d. It may be corrupt. Giving up.",
|
||||||
|
x, z)
|
||||||
|
else:
|
||||||
|
logging.warning("Tried several times to read chunk %d,%d. Unknown error. Giving up.",
|
||||||
|
x, z)
|
||||||
logging.debug("Full traceback:", exc_info=1)
|
logging.debug("Full traceback:", exc_info=1)
|
||||||
# Let this exception propagate out through the C code into
|
# Let this exception propagate out through the C code into
|
||||||
# tileset.py, where it is caught and gracefully continues
|
# tileset.py, where it is caught and gracefully continues
|
||||||
|
|||||||
Reference in New Issue
Block a user