From 435ab1e3acbe370745560a095edd5a41a36af265 Mon Sep 17 00:00:00 2001 From: Maciek Borzecki Date: Mon, 19 Jan 2015 21:32:09 +0100 Subject: [PATCH] devicechannel: receive() will catch all IOErrors internally --- src/devicechannel.vala | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/devicechannel.vala b/src/devicechannel.vala index 8a79a82..812de01 100644 --- a/src/devicechannel.vala +++ b/src/devicechannel.vala @@ -145,7 +145,7 @@ class DeviceChannel : Object { * * @return false if channel was closed, true otherwise */ - public async bool receive() throws Error { + public async bool receive() { size_t line_len; string data = null; // read line up to newline @@ -154,6 +154,9 @@ class DeviceChannel : Object { Priority.DEFAULT, null, out line_len); + // expecting \n\n + _din.read_byte(); + _din.read_byte(); } catch (IOError ie) { debug("I/O error: %s", ie.message); } @@ -164,9 +167,6 @@ class DeviceChannel : Object { } debug("received line: %s", data); - // expecting \n\n - _din.read_byte(); - _din.read_byte(); Packet pkt = Packet.new_from_data(data); if (pkt == null) {