- From: Martin Duerst <duerst@w3.org>
- Date: Thu, 23 Sep 2004 22:31:56 +0900
- To: Dominique Haza(wrong string) uM(B-Massieux <dom@w3.org>
- Cc: Bjoern Hoehrmann <derhoermi@gmx.net>, Terje Bless <link@pobox.com>, QA Dev <public-qa-dev@w3.org>
At 11:51 04/09/22 +0200, Dominique Haza$BuM(B-Massieux wrote: >Le mer 22/09/2004 $B_~(B08:13, Martin Duerst a $Bic(Brit : > > For all this stuff, this is the biggest issue. And although > > much of error reporting with respect to charset detection/conversion > > is handled quite specially, it would be good to have a general > > solution. I can immagine several ways to do this: > > [...] > >What about exceptions (in the POO meaning)? That's one idea. But I think exceptions should only be used if something really went wrong. The charset detection/conversion module, however, may be used by a wide range of clients, from extremely picky (e.g. the validator) to extremely lax (the link checker). The validator wants to know about any disagreements between charsets, even if the specs say that disagreements are okay (well, they don't exactly say they are okay, but just give priority). For the link checker, it's okay to convert if possible, otherwise just leave things as bytes (or pretend to do so), because we don't want it to fail if there is some non-convertible non-ASCII text in a document but all the link stuff is in ASCII only. Given that, I think exceptions are not such a good idea. Btw, I have successfully used an exception in the RDF validator, written in Java, where it was a very convenient way to get out of a method in all kinds of situations: http://dev.w3.org/cvsweb/java/classes/org/w3c/rdf/examples/ARPServlet.java?r ev=1.78&content-type=text/x-cvsweb-markup, the getRDFfromURI method. But this has a totally different code structure (mixing the http fetch and the character detection in a single method) and only one client. Also, exceptions can catch one error, but they are not very good at reporting various errors in sequence out of the same code. (unless perl exceptions are so much better than anything else I know). Regards, Martin.
Received on Thursday, 23 September 2004 15:17:09 UTC