Stuart Moffatt said: > Under "Other implementations", Error.pm is listed as a best option. I > have test code that I run on the command line which Does the Right > Thing, but when I run it under mod_perl, the 'throw' handler in Error > does a die(), which mod_perl sees as a 500 error and logs it BEFORE I > get back to my catch handler to Do the Right Thing.
Sounds like you have something that installs a __DIE__ handler and isn't honoring the fact that you are in eval context here. > Is Error.pm really a best option for mod_perl? The throw and catch functions added by Error.pm are dangerous and in my opinion they should be avoided in any environment. They can easilly lead to obscure mistaked and accidental memory growth. You can find lots of discussion about this in the mailing list archives. > BTW, I tried the My::Exception and it failed right away: I can't catch > a die (aka throw) without having to do [EMAIL PROTECTED]>isa all over the place. I > may as well just use a response object that has a code and a > message...which isn't really exception handling. Exception::Class is a popular option, although it's mostly just a nicer container for your error data. There is no way around having to check isa() if you want to catch only specific errors. Error.pm does this for you, but you can easilly write your own sub to check isa() and take some action. - Perrin > Thanks, > Stuart > > Stuart Moffatt - [EMAIL PROTECTED] > Software Developer, User Interface - (613)591-6655 x2009 > http://www.bridgewatersystems.com > > -- > Reporting bugs: http://perl.apache.org/bugs/ > Mail list info: http://perl.apache.org/maillist/modperl.html -- Reporting bugs: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html