aboutsummaryrefslogtreecommitdiff
path: root/xmpp-vala/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'xmpp-vala/src/core')
-rw-r--r--xmpp-vala/src/core/stanza_node.vala2
-rw-r--r--xmpp-vala/src/core/stanza_reader.vala11
2 files changed, 10 insertions, 3 deletions
diff --git a/xmpp-vala/src/core/stanza_node.vala b/xmpp-vala/src/core/stanza_node.vala
index 7a68da62..56f857d4 100644
--- a/xmpp-vala/src/core/stanza_node.vala
+++ b/xmpp-vala/src/core/stanza_node.vala
@@ -29,7 +29,7 @@ public abstract class StanzaEntry {
case '\'': result_builder.append("'"); break;
case '<': result_builder.append("&lt;"); break;
case '>': result_builder.append("&gt;"); break;
- default: error("Unreachable"); break;
+ default: error("Unreachable");
}
return false;
});
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;