Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Is err:XC0201 really helpful on p:uncompress? #289
Suppose I uncompress some data. If the resulting stream can be parsed as its content type, good, we're done.
Suppose it can't be parsed. If it can't, then the attempt to parse it must have raised an exception (e.g,
Pro: the exception you have to catch from
What do folks think?
The "masking" seems to be a result of your implementation strategy. In my implementation the parser doesnt generate XProc errrors (like XD0049), but throws eg. a SAXException. My implementation has to catch this and throw XC0201.
In general I would prefer to keep XC0201 because the casting error might not necessarily come from XML parsing. Suppose the uncompressed document claims to be "image/jpeg" and my implementation tests this claim. Currently XC0201 is the error to raise. No other error will fit.