On 8/4/06, Todd Ross <[EMAIL PROTECTED]> wrote:
So, as requested, I'm preparing a patch to add test cases for expanding
the scope of the error_mode functionality.

The hooks for prerun and postrun are pretty straight forward; they happen
during run() execution so it's a natural extension of the existing
error_mode functionality.

I'd like to catch problems in setup() and/or the hook for init, but that
happens during new() so calling the error_mode doesn't really make sense.

Additionally, I'm not sure what to do with the hooks for teardown and
load_tmpl.  In all the use cases I can come up with, load_tmpl is being
called from within a runmode, so it's already covered.  Maybe my
imagination is too limited, but I find the same scenario for custom hooks
(specifically, they'd be handled by the runmode).  I don't have much
exposure to CGI::Application Plugins though, so if anyone's maintaining a
plugin that could benefit from error_mode error handling, please speak up.
 The teardown hook happens after the content has been generated, so it's
too late to do anything useful as far as recovering or displaying an error
page to the user.

Is anyone else interested in the expanded error handling?  Any thoughts to
add?  Cees?

Yeah - start with the low-hanging fruit, particularly if that's what
you have use for. I knew that the original error_mode patch wasn't
complete. I just didn't have a good understanding of the use cases.
So, write the patch to cover the use cases YOU need and document what
it does and doesn't do. (This may have been the failing of the
original patch.) Then, when someone needs an expansion of the
functionality, they will do what you did and post on the list. And,
we'll tell them what we told you - write a failing test.

The reason you want to do it this way is that unless you have a use
case, you will NOT understand the ramifications around the situation.
This means you WILL implement it poorly. Not because you're a poor
implementor, but because you will be implementing the wrong thing.
And, worst case, it will be subtly wrong.

Plus, if you do the simplest thing that could possibly work, then
you'll be done faster. This could easily start you off on shaving a
yak.

So, do what YOU need to do, document what you didn't touch, and call it a day.

Rob

---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/cgiapp@lists.erlbaum.net/
             http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to