when a second error happens during the fallback attempt, raise both errors
This commit is contained in:
parent
8716c8994b
commit
bbb37dbca8
14
mclevel.py
14
mclevel.py
@ -704,6 +704,9 @@ class MCLevel(object):
|
|||||||
'''
|
'''
|
||||||
info( u"Identifying " + filename )
|
info( u"Identifying " + filename )
|
||||||
|
|
||||||
|
class LoadingError(RuntimeError): pass
|
||||||
|
|
||||||
|
|
||||||
if not filename:
|
if not filename:
|
||||||
raise IOError, "File not found: "+filename
|
raise IOError, "File not found: "+filename
|
||||||
if not os.path.exists(filename):
|
if not os.path.exists(filename):
|
||||||
@ -769,10 +772,13 @@ class MCLevel(object):
|
|||||||
except Exception, e:
|
except Exception, e:
|
||||||
info( u"Error during NBT load: {0!r}".format(e) )
|
info( u"Error during NBT load: {0!r}".format(e) )
|
||||||
info( u"Fallback: Detected compressed flat block array, yzx ordered " )
|
info( u"Fallback: Detected compressed flat block array, yzx ordered " )
|
||||||
lev = MCJavaLevel(filename, data);
|
try:
|
||||||
lev.compressed = compressed;
|
lev = MCJavaLevel(filename, data);
|
||||||
return lev;
|
lev.compressed = compressed;
|
||||||
|
return lev;
|
||||||
|
except Exception, e2:
|
||||||
|
raise LoadingError, ("Multiple errors encountered", e, e2)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
if(MCIndevLevel._isTagLevel(root_tag)):
|
if(MCIndevLevel._isTagLevel(root_tag)):
|
||||||
info( u"Detected Indev .mclevel" )
|
info( u"Detected Indev .mclevel" )
|
||||||
|
Reference in New Issue
Block a user