diff options
author | Jaime van Kessel <nallath@gmail.com> | 2016-09-02 11:16:11 +0300 |
---|---|---|
committer | Jaime van Kessel <nallath@gmail.com> | 2016-09-02 11:16:11 +0300 |
commit | d7d18043196734ae98da57ea24033b34cd485765 (patch) | |
tree | c4168abe2eccf20c603f97beddd26d4ddd5c3484 /plugins | |
parent | 6c6ced404867806510d760514a0b9744a0c0a956 (diff) |
Added correct exception handling for .curaprofile importing
CURA-2252
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/CuraProfileReader/CuraProfileReader.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/plugins/CuraProfileReader/CuraProfileReader.py b/plugins/CuraProfileReader/CuraProfileReader.py index 8007a8e696..772b11890b 100644 --- a/plugins/CuraProfileReader/CuraProfileReader.py +++ b/plugins/CuraProfileReader/CuraProfileReader.py @@ -26,7 +26,11 @@ class CuraProfileReader(ProfileReader): # not be read or didn't contain a valid profile, \code None \endcode is # returned. def read(self, file_name): - archive = zipfile.ZipFile(file_name, "r") + try: + archive = zipfile.ZipFile(file_name, "r") + except Exception: + # zipfile doesn't give proper exceptions, so we can only catch broad ones + return [] results = [] for profile_id in archive.namelist(): # Create an empty profile. |