diff --git a/plugins/module_utils/entity.py b/plugins/module_utils/entity.py index 575bb690..6be85e97 100644 --- a/plugins/module_utils/entity.py +++ b/plugins/module_utils/entity.py @@ -411,12 +411,9 @@ def _fetch_url( return {"status_code": status_code} if resp_json is None: - try: - if info.get("msg"): - resp_json_msg = "{}".format(info.get("msg")) - else: - resp_json_msg = "Failed to convert API response to json" - except ValueError: + if info.get("msg"): + resp_json_msg = "{}".format(info.get("msg")) + else: resp_json_msg = "Failed to convert API response to json" self.module.fail_json(