mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-25 14:20:22 -07:00
Update bare exceptions to specify Exception.
This will keep us from accidentally catching program-exiting exceptions like KeyboardInterupt and SystemExit.
This commit is contained in:
parent
5147e792d3
commit
3fba006207
320 changed files with 659 additions and 656 deletions
|
@ -147,7 +147,7 @@ def content_to_dict(module, content):
|
|||
if not content_dict:
|
||||
raise Exception()
|
||||
|
||||
except:
|
||||
except Exception:
|
||||
module.fail_json(msg="Unable to convert 'content' to a dict, please check if valid")
|
||||
|
||||
# replace the string with the dict
|
||||
|
@ -163,7 +163,7 @@ def do_load_resource(module, collection, name):
|
|||
|
||||
try:
|
||||
item = find_collection_item(collection, name, '')
|
||||
except:
|
||||
except Exception:
|
||||
module.fail_json(msg="An error occurred while running 'find_collection_item'")
|
||||
|
||||
if item.exists:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue