diff --git a/letsencrypt/client/apache_configurator.py b/letsencrypt/client/apache_configurator.py index 9612b5872..28b9c9471 100644 --- a/letsencrypt/client/apache_configurator.py +++ b/letsencrypt/client/apache_configurator.py @@ -928,7 +928,7 @@ LogLevel warn \n\ subprocess.check_call(["sudo", "a2enmod", mod_name], stdout=open("/dev/null", 'w'), stderr=open("/dev/null", 'w')) # Hopefully this waits for output subprocess.check_call(["sudo", "/etc/init.d/apache2", "restart"], stdout=open("/dev/null", 'w'), stderr=open("/dev/null", 'w')) - except Exception as e: + except (OSError, subprocess.CalledProcessError) as e: logger.error("Error enabling mod_" + mod_name) logger.error("Exception: %s" % str(e)) sys.exit(1)