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

Chuck Hagenbuch chuck at horde.org
Mon Feb 23 19:13:33 UTC 2009


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.

-chuck


More information about the dev mailing list