[XML-SIG] Another SAX Suggestion

Paul Prescod paul@prescod.net
Sat, 01 May 1999 13:03:15 -0500


Fredrik Lundh wrote:
> 
> I strongly agree.  libraries shouldn't print stuff unless
> you explicitly tell them to.  use exceptions instead.

Exceptions are maybe okay for fatal error messages, but what about
non-fatal errors and warnings?

> > Anybody else remember "RANGE ERROR" from the
> > C math library?

That was a very, very different situation. See below.

> anybody else stumbled upon the "Enter username/
> Enter password" stuff down in urllib.py?

I think that halting execution pending user input is a little bit more
severe than outputting text to stderr!

Anyhow, in the days of the ill-fated Taligent they made a distinction
between a "library", an "application" and an "application framework."

Parsers are definately libraries. HandlerBase is an application framework:
you use it *only* to get its default behavior. If you don't want the
behavior it gives you then you either don't use it or override the
appropriate methods to make it do what you want.

How about if we give HandlerBase a single initialization parameter which
is the stream to output to. If you are a server or GUI app writer all you
need to do is pass in a null output stream to get the error handling you
want.

Anyhow, I find it hard to believe that either Infoseek or PythonWare is
going to write a search engine or graphics renderer and forget to think
about where error messages should go! More likely it is the hordes of
simple filter writers who will forget -- so the default should be
optimized for them.

-- 
 Paul Prescod  - ISOGEN Consulting Engineer speaking for only himself
 http://itrc.uwaterloo.ca/~papresco

"Microsoft spokesman Ian Hatton admits that the Linux system would have
performed better had it been tuned."
"Future press releases on the issue will clearly state that the research
was sponsored by Microsoft."
  http://www.itweb.co.za/sections/enterprise/1999/9904221410.asp