Catch correct exception in case of duplicate submission

This commit is contained in:
Lauri Võsandi 2021-09-29 13:41:28 +03:00
parent 6508ade008
commit 9e3c43588a

View File

@ -140,7 +140,7 @@ class RequestListResource(object):
logger.info("Signed %s as %s is whitelisted for autosign", common_name, req.context["remote"]["addr"]) logger.info("Signed %s as %s is whitelisted for autosign", common_name, req.context["remote"]["addr"])
return return
except EnvironmentError: except errors.RequestExists:
logger.info("Autosign for %s from %s failed, signed certificate already exists", logger.info("Autosign for %s from %s failed, signed certificate already exists",
common_name, req.context["remote"]["addr"]) common_name, req.context["remote"]["addr"])
reasons.append("autosign failed, signed certificate already exists") reasons.append("autosign failed, signed certificate already exists")