# from Christopher J. Madsen
# on Sunday 16 March 2008 23:37:

>Christopher J. Madsen wrote:
>> * Otherwise, a pre-hook must return 'continue'.  Returning anything
>>   else is an error.  (This is to prevent hooks that just happen to
>>   return the value of their last expression from causing mysterious
>>   problems.)
>
>I've just realized that this has been misunderstood.  I wasn't saying
>that this is how a plugin reports an error.  You use "die" for that. 

Understood.

> I was saying that if a pre hook returns anything other than 'done' or
> 'continue', then the plugin manager reports "Invalid return value
> from ...".  In other words, it's a bug in the plugin, which the
> plugin manager will catch and report.

I'm still not convinced that the return values have enough significance 
to warrant that kind of stricture.  At least, not for ACTION_* methods.

For all other methods, the continue/done return really seems like it 
would get in the way, but I still don't have a clear picture of how 
pre_/post_ hooks for regular methods would be used (and/or made to 
work.)

--Eric
-- 
Cult: A small, unpopular religion.
Religion: A large, popular cult.
-- Unknown
---------------------------------------------------
    http://scratchcomputing.com
---------------------------------------------------

Reply via email to