From 40380b67e04d907981e7f146705312498ee13c7c Mon Sep 17 00:00:00 2001 From: Drake Panzer Date: Wed, 3 May 2023 12:26:02 -0600 Subject: [PATCH] fix error class --- check_docker/check_docker/check_docker.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/check_docker/check_docker/check_docker.py b/check_docker/check_docker/check_docker.py index 8789146..8693baf 100755 --- a/check_docker/check_docker/check_docker.py +++ b/check_docker/check_docker/check_docker.py @@ -937,8 +937,8 @@ def perform_checks(raw_args): ############################################################################################# try: containers = get_containers(args.containers, args.present) - except ConnectionRefusedError: - critical('Failed to connect to daemon: connection refused.') + except URLError as e: + critical(f'Failed to connect to daemon: {e.reason}.') if len(containers) == 0 and not args.present: unknown("No containers names found matching criteria")