>        #test adding config at request time
>   -    my $errmsg = $r->add_config(['require valid-user']);
>   -    die $errmsg if $errmsg;
>   +    $r->add_config(['require valid-user']);

I don't know about this.  I was going to work up my thoughts as a result of
another thread, but I might as well do so here...

I think it's a bad practice for a persistent OO interface to die at runtime.
  what you've done means that I need to now use eval() logic to handle the
exception, rather than simply checking the return value - several extra
lines of code (and processing) when 1 will do just fine.  and it further
obscures our interface: which methods do I need to trap with eval() and
which can I trust not to die again?

I think it's ok to die at startup or something, but if your request-time
handler dies request after request because of, say, a different
AllowOverrides config, it's bad.  I've followed this rule in my own
persistent environments (not only mod_perl :) and found it really to be a
best practice.

so, I'd suggest re-thinking this a bit.  I understand what you were trying
to solve, but maybe there is another way?  maybe call croak on
$s->add_config but not $r->add_config?

--Geoff




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to