From 5129d90b45f0862cd44ccf2904ae72d37c6fa0f1 Mon Sep 17 00:00:00 2001 From: Kevin Smith Date: Tue, 29 May 2012 13:55:06 +0100 Subject: Don't throw exceptions for receiving illegal XML diff --git a/src/com/isode/stroke/parser/AaltoXMLParser.java b/src/com/isode/stroke/parser/AaltoXMLParser.java index 041dc1e..52fabea 100644 --- a/src/com/isode/stroke/parser/AaltoXMLParser.java +++ b/src/com/isode/stroke/parser/AaltoXMLParser.java @@ -47,6 +47,7 @@ class AaltoXMLParser extends XMLParser { inputFeeder.feedInput(xmlBytes, 0, xmlBytes.length); } catch (XMLStreamException ex) { error = true; + /* This is an unexpected error */ throw new IllegalStateException(ex); } @@ -75,7 +76,7 @@ class AaltoXMLParser extends XMLParser { } } catch (XMLStreamException e) { error = true; - throw new IllegalStateException(e); + /* This type of error (illegal XML) is ~expected */ } if (type == XMLStreamConstants.END_DOCUMENT) { try { -- cgit v0.10.2-6-g49f6