From f4071f77dada7cb061938b6745f788dde679803d Mon Sep 17 00:00:00 2001 From: Maciek Borzecki Date: Sat, 17 Jan 2015 15:49:12 +0100 Subject: [PATCH] devicechannel: catch connect error --- src/devicechannel.vala | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/devicechannel.vala b/src/devicechannel.vala index 7f2388f..0cbdfc7 100644 --- a/src/devicechannel.vala +++ b/src/devicechannel.vala @@ -42,7 +42,16 @@ class DeviceChannel : Object { assert(this._isa != null); var client = new SocketClient(); - _conn = yield client.connect_async(_isa); + try { + _conn = yield client.connect_async(_isa); + } catch (Error e) { + // + critical("failed to connect to %s:%u: %s", + _isa.address.to_string(), _isa.port, + e.message); + return; + // TODO emit disconnected signal? + } debug("connected to %s:%u", _isa.address.to_string(), _isa.port);