0

world: Don't call sys.exit here, raise something

A world being unsupported may not be a fatal application error in
all instances where this codepath in world.py is used, hence
throwing an exception is more sensible.
This commit is contained in:
Nicolas F
2018-05-09 14:25:05 +02:00
parent b9be8f8ffd
commit ebdc4016d7
2 changed files with 19 additions and 7 deletions

View File

@@ -470,6 +470,10 @@ dir but you forgot to put quotes around the directory, since it contains spaces.
except CorruptNBTError, e:
logging.error("Failed to open world %r", render['world'])
raise e
except world.UnsupportedVersion, e:
for ln in str(e).split('\n'):
logging.error(ln)
sys.exit(1)
worldcache[render['world']] = w