mirror of
https://github.com/grahampugh/macadmin-scripts.git
synced 2025-12-17 17:56:33 +00:00
Catch IOError exception when trying to read the SeedCatalogs.plist; print any errors around SeedCatalogs.plist access to stderr.
This commit is contained in:
parent
e27cd94c07
commit
9f9ec905e8
@ -98,7 +98,8 @@ def get_seeding_program(sucatalog_url):
|
||||
if sucatalog_url == value:
|
||||
return key
|
||||
return ''
|
||||
except (OSError, ExpatError, AttributeError, KeyError):
|
||||
except (OSError, IOError, ExpatError, AttributeError, KeyError) as err:
|
||||
print(err, file=sys.stderr)
|
||||
return ''
|
||||
|
||||
|
||||
@ -107,7 +108,8 @@ def get_seed_catalog(seedname='DeveloperSeed'):
|
||||
try:
|
||||
seed_catalogs = read_plist(SEED_CATALOGS_PLIST)
|
||||
return seed_catalogs.get(seedname)
|
||||
except (OSError, ExpatError, AttributeError, KeyError):
|
||||
except (OSError, IOError, ExpatError, AttributeError, KeyError) as err:
|
||||
print(err, file=sys.stderr)
|
||||
return ''
|
||||
|
||||
|
||||
@ -116,7 +118,8 @@ def get_seeding_programs():
|
||||
try:
|
||||
seed_catalogs = read_plist(SEED_CATALOGS_PLIST)
|
||||
return list(seed_catalogs.keys())
|
||||
except (OSError, ExpatError, AttributeError, KeyError):
|
||||
except (OSError, IOError, ExpatError, AttributeError, KeyError) as err:
|
||||
print(err, file=sys.stderr)
|
||||
return ''
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user