Handle ValueError from hot_package
translate_parameter method of hot_package converter may raise ValueError exception. It should be handled and raise PackageLoadError. Change-Id: Icd66da398dc7e2fc91802b3420e3f708f801a111 Closes-bug: #1450541
This commit is contained in:
parent
ed6c26c8ca
commit
22f74a56a7
@ -49,6 +49,9 @@ def load_from_file(archive_path, target_dir=None, drop_dir=False,
|
||||
package = zipfile.ZipFile(archive_path)
|
||||
package.extractall(path=target_dir)
|
||||
return load_from_dir(target_dir, preload=True, loader=loader)
|
||||
except ValueError as err:
|
||||
raise e.PackageLoadError("Couldn't load package from file: "
|
||||
"{0}".format(err))
|
||||
finally:
|
||||
if drop_dir:
|
||||
if created:
|
||||
|
Loading…
x
Reference in New Issue
Block a user