diff options
| author | Marvin W <git@larma.de> | 2026-10-04 22:02:19 +0200 |
|---|---|---|
| committer | Marvin W <git@larma.de> | 2026-10-23 17:01:43 +0200 |
| commit | 3e136fc57a2e509e5a4dd265a798b196205b0a80 (patch) | |
| tree | c8f9fc5d82bc458c27cf378bf1bf3f0fda51497b /xmpp-vala/src/core/stanza_reader.vala | |
| parent | 630b1368331ef0034b343bd2f00b116c8cd90391 (diff) | |
Fix more warnings
Diffstat (limited to 'xmpp-vala/src/core/stanza_reader.vala')
| -rw-r--r-- | xmpp-vala/src/core/stanza_reader.vala | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/xmpp-vala/src/core/stanza_reader.vala b/xmpp-vala/src/core/stanza_reader.vala index ff512497..4828600d 100644 --- a/xmpp-vala/src/core/stanza_reader.vala +++ b/xmpp-vala/src/core/stanza_reader.vala @@ -38,8 +38,15 @@ public class StanzaReader { if (cancellable != null && cancellable.is_cancelled()) throw new IOError.CANCELLED("Input stream is canceled."); try { buffer_fill = (int) yield ((!)input).read_async(buffer, GLib.Priority.DEFAULT, cancellable); - } catch (TlsError.EOF e) { - throw new IOError.CLOSED("End of TLS stream reached"); + } catch (Error e) { + if (e is IOError) { + throw (IOError) e; + } else if (e is TlsError.EOF) { + // The error can be TlsError.EOF instead of IOError.CLOSED, fixing that + throw new IOError.CLOSED("End of TLS stream reached"); + } else { + throw new IOError.FAILED("Unknown error: %s", e.message); + } } if (buffer_fill == 0) throw new IOError.CLOSED("End of input stream reached."); buffer_pos = 0; |
