app: fix error reporting when connection to qubesd fails

Properly report QubesDaemonCommunicationError, instead of confusing
IOError or FileNotFoundError
This commit is contained in:
Marek Marczykowski-Górecki 2018-07-14 01:49:14 +02:00
parent 86a4f59fd4
commit a481490d60
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -471,9 +471,9 @@ class QubesLocal(QubesBase):
try: try:
client_socket = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) client_socket = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
client_socket.connect(qubesadmin.config.QUBESD_SOCKET) client_socket.connect(qubesadmin.config.QUBESD_SOCKET)
except IOError: except (IOError, OSError) as e:
# TODO: raise qubesadmin.exc.QubesDaemonCommunicationError(
raise 'Failed to connect to qubesd service: %s', str(e))
# src, method, dest, arg # src, method, dest, arg
for call_arg in ('dom0', method, dest, arg): for call_arg in ('dom0', method, dest, arg):