mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 14:22:46 +00: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:
@@ -183,7 +183,7 @@ class MSCModule(object):
|
||||
elif self.status >= 400:
|
||||
try:
|
||||
payload = json.loads(resp.read())
|
||||
except:
|
||||
except Exception:
|
||||
payload = json.loads(info['body'])
|
||||
if 'code' in payload:
|
||||
self.fail_json(msg='MSC Error {code}: {message}'.format(**payload), data=data, info=info, payload=payload)
|
||||
|
||||
Reference in New Issue
Block a user