0

Better error handling of errors when a world fails to open.

A common case is a corrupt (or empty) level.dat file.  This condition
wasn't properly caught, yielding a less-than-useful stack trace.  Even
more concerning is that this could happen when a user is just running
"overviewer.py" to get a world listing.

This has been fixed to improve the user experience
This commit is contained in:
Andrew Chin
2016-12-19 10:50:01 -05:00
parent b81661dc94
commit 3938d1889c
3 changed files with 28 additions and 9 deletions

View File

@@ -189,7 +189,7 @@ class NBTFileReader(object):
payload = self._read_tag_compound()
return (name, payload)
except (struct.error, ValueError), e:
except (struct.error, ValueError, TypeError), e:
raise CorruptNBTError("could not parse nbt: %s" % (str(e),))
# For reference, the MCR format is outlined at