I've just run into a serious flaw with CGI::Application which completely breaks my exception handling.2. It executes the run-mode within an eval {} block of its own, catches any exceptions raised and then simply throws them again after having added a bit to them ("Error executing run mode...").This makes the gross presumption that the run-mode didn't raise an exception *object*. If it did, then it just gets stringified into C::A's string error before getting thrown again. Thus, every exception that I ever raise myself gets caught, stringified and rethrown. My catcher() method catches it, of course, but I now find that *all* my exception objects have become "uncaught [string] exceptions" that my catcher() has caught. There is no point in any of the Exception::Classes that I've been carefully building!Why bother catching the exception at all, just to throw it again? There's no point unless you're going to *do* something with it in some circumstances. Simply prepending a string to it just screws it up when it's an object. You could catch the exception and prepend a string only if it is already a string (not an object), but even then you're screwing up Exception::Class' record of where the exception was thrown from.
I complained about the same thing a couple of months ago and strongly second this motion.
The attached patch (against 3.1) fixes both of these things. PLEEEEEASE can we have this patch, or something equivalent, applied?
Yes, PLEEEEEEEEASE.
Thilo
---------------------------------------------------------------------
Web Archive: http://www.mail-archive.com/suppressed/
http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed
Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.