Hi ! Since we are speaking of this, where i can get a list of all python exceptions ?
See ya ! Em Qua 01 Dez 2004 19:26, Ian Bicking escreveu: > Winston Wolff wrote: > > You could catch the exception and write the error message. Something > > like this (I haven't tested it): > > <% > > try: > > import MySQLdb > > except ImportError: > > self.writeln("You need MySQLdb in the PYTHONPATH or installed > > libraries to run this PSP page.") > > return > > %> > > > > > > If you want a more elaborate error handling system, you could add a > > method writeError() to the base class of your pages and call that, which > > would write out a nice HTML page with your error message. Of course for > > this to work, you need to arrange your pages such that the processing > > and error checking is done before you output any HTML. Otherwise, your > > partially written HTML would be mixed with the HTML from writeError(). > > I'm not sure with PSP, but it might be something like: > > def _respond(self, trans): > try: > Page._respond(self, trans) > except ImportError, e: > self.writeln("Error; missing package.<br><b>%s</b>" % e) -- Douglas Soares de Andrade - UnilesteMG dsa em unilestemg.br - Linux User: #237615 http://douglasandrade.tk ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/ _______________________________________________ Webware-discuss mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/webware-discuss