[dev] [cvs] commit: framework/Notification Notification.php

Jan Schneider jan at horde.org
Tue Feb 24 00:00:34 UTC 2009


Zitat von Chuck Hagenbuch <chuck at horde.org>:

> Quoting Michael M Slusarz <slusarz at horde.org>:
>
>>>> slusarz     2009-02-22 22:40:36 EST
>>>>
>>>> Modified files:
>>>>  Notification         Notification.php
>>>> Log:
>>>> Get code info from PEAR_Error object, if necessary.
>>>>
>>>> Revision  Changes    Path
>>>> 1.71      +6 -3      framework/Notification/Notification.php
>>>
>>> I'm not sure if this is a good idea, since the code doesn't have to be
>>> a valid notification class, e.g. if a PEAR_Error bubbles from an
>>> external PEAR package.
>>
>> Doesn't Notification ignore a class it doesn't recognize?
>
> But this would be a PEAR_Error. Oh, you mean the kind of  
> notification class. Yes, it does - but this means that those errors  
> would disappear instead of showing up as horde.error. That's not  
> good for BC (or really friendly, imo).
>
>> The main advantage is to reduce this annoying statement:
>> $notification->push($e, $e->getCode());
>>
>> to this:
>> $notification->push($e);
>
> I don't think it really makes sense to have exception codes be  
> notification classes. The exception codes should be class constants  
> describing what happened to cause the exception, if anything. In my  
> opinion of course.

And if you really want to push exceptions on the notification stack,  
you can simply mimic the PEAR_Error behavior. You can already now push  
PEAR_Errors without specifying the notification class.

Jan.

-- 
Do you need professional PHP or Horde consulting?
http://horde.org/consulting/



More information about the dev mailing list