gpg: don't crash gpg-agent on error

This commit is contained in:
Roman Zeyde
2016-10-18 20:47:02 +03:00
parent 0ad0ca3b9a
commit 5b61702205

View File

@@ -66,7 +66,10 @@ def run_agent(args): # pylint: disable=unused-argument
with server.unix_domain_socket_server(sock_path) as sock:
for conn in agent.yield_connections(sock):
with contextlib.closing(conn):
agent.handle_connection(conn)
try:
agent.handle_connection(conn)
except Exception as e: # pylint: disable=broad-except
log.exception('gpg-agent failed: %s', e)
def main():