From 4659d3f54416122a5139bd5c83ad1633b87ac26e Mon Sep 17 00:00:00 2001 From: Mariam Ahhttouche Date: Tue, 17 Feb 2026 15:29:03 +0100 Subject: [PATCH] uv_python module: remove catch all exception --- plugins/modules/uv_python.py | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/plugins/modules/uv_python.py b/plugins/modules/uv_python.py index e1916d7f94..58720b3d63 100644 --- a/plugins/modules/uv_python.py +++ b/plugins/modules/uv_python.py @@ -199,18 +199,15 @@ def main(): ) state = module.params["state"] - try: - uv = UV(module) - if state == "present": - result["changed"], result["msg"] = uv.install_python() - elif state == "absent": - result["changed"], result["msg"] = uv.uninstall_python() - elif state == "latest": - result["changed"], result["msg"] = uv.upgrade_python() + uv = UV(module) + if state == "present": + result["changed"], result["msg"] = uv.install_python() + elif state == "absent": + result["changed"], result["msg"] = uv.uninstall_python() + elif state == "latest": + result["changed"], result["msg"] = uv.upgrade_python() - module.exit_json(**result) - except Exception as e: - module.fail_json(msg=str(e)) + module.exit_json(**result) if __name__ == "__main__": main() \ No newline at end of file