From: Anders Borch Date: 2003-06-10T00:40:35+09:00 Subject: Re: [ANN] sql-serialize 0.0.3 Brian Candler wrote: > On Mon, Jun 09, 2003 at 03:56:46AM +0900, Anders Borch wrote: > >>if a nameerror, typeerror or the like happens then hopefully my program >>will instantly crash and the user will scream at me until I fix it. > > > Not if sql-serialize is meant to be a general-purpose library. The main > program very possibly has an exception catcher which formats or logs the > error and then lets the user continue. > > If sql-serialize is just your own self-contained application, of course, you > can choose to have it work in the way you describe. > I plan (and hope) that others will use this... but while developing this beast then I'll probably take the approach of Mark Crispin (developer of c-client library): "if i meet anything unexpected then I'll kill the process" - this guy actually called abort() in stead of returning error codes. A very evil approach but it makes for easy debugging. > >>I'm >>trying to catch as few exceptions as possible so I may see where they >>occur the hard way... it may just be me, but I find it easier to debug >>my code if it fails the instant an exception occurs. > > > You just catch the exception and re-raise it, exactly as you showed (except > 'rescue Exception => e' not a DBI::Exception). a sound idea... > Regards, > > Brian. >