From d5d305193ce527f1cc3022c406de35d9a85d4ccb Mon Sep 17 00:00:00 2001 From: hrxi Date: Sun, 1 Sep 2019 18:18:25 +0200 Subject: Fix some warnings Instances of `RegexError` are just asserted as `assert_not_reached` as they cannot really fail except for allocation failure if the given regex is valid. --- xmpp-vala/src/module/xep/0234_jingle_file_transfer.vala | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'xmpp-vala/src/module/xep/0234_jingle_file_transfer.vala') diff --git a/xmpp-vala/src/module/xep/0234_jingle_file_transfer.vala b/xmpp-vala/src/module/xep/0234_jingle_file_transfer.vala index 25fe3ce4..951ea7b7 100644 --- a/xmpp-vala/src/module/xep/0234_jingle_file_transfer.vala +++ b/xmpp-vala/src/module/xep/0234_jingle_file_transfer.vala @@ -56,8 +56,13 @@ public class Module : Jingle.ContentType, XmppStreamModule { .put_node(new StanzaNode.build("size", NS_URI).put_node(new StanzaNode.text(size.to_string())))); // TODO(hrxi): Add the mandatory hash field - Jingle.Session session = stream.get_module(Jingle.Module.IDENTITY) - .create_session(stream, Jingle.TransportType.STREAMING, receiver_full_jid, Jingle.Senders.INITIATOR, "a-file-offer", description); // TODO(hrxi): Why "a-file-offer"? + Jingle.Session session; + try { + session = stream.get_module(Jingle.Module.IDENTITY) + .create_session(stream, Jingle.TransportType.STREAMING, receiver_full_jid, Jingle.Senders.INITIATOR, "a-file-offer", description); // TODO(hrxi): Why "a-file-offer"? + } catch (Jingle.Error e) { + throw new IOError.FAILED(@"couldn't create Jingle session: $(e.message)"); + } session.terminate_on_connection_close = false; yield session.conn.input_stream.close_async(); -- cgit v1.2.3-70-g09d2