Merge pull request #58 from felixonmars/improve-error
Improve error message for non-exist nvtake targets
This commit is contained in:
commit
0912747416
|
@ -31,7 +31,13 @@ def take():
|
|||
newvers = core.read_verfile(s.newver)
|
||||
|
||||
for name in args.names:
|
||||
oldvers[name] = newvers[name]
|
||||
try:
|
||||
oldvers[name] = newvers[name]
|
||||
except KeyError:
|
||||
logger.fatal(
|
||||
"%s doesn't exist in 'newver' set.", name
|
||||
)
|
||||
sys.exit(2)
|
||||
|
||||
try:
|
||||
os.rename(s.oldver, s.oldver + '~')
|
||||
|
|
Loading…
Reference in New Issue