Re: Re: PEAR_Exception in CVS
| From: | Justin Patrin | Date: | Fri, 02 Jul 2004 16:41:16 +0000 |
| Subject: | Re: Re: PEAR_Exception in CVS | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-31498@lists.php.net to get a copy of this message | ||
[snip]
>
> Observer -> Decorator ?
> Looks more appropriate in this case.
>
> Still, if you maintain a database of error translations where an error code is
> linked to an error message, you'd just need to know in which language the
> application is running and which code has been triggered. So you wouldn't need
> decorators or observers as you call them.
>
> In order to keep it simple, just give an error code and it is up to the user to
> define the needed translations according to the given error codes and their
> meaning, which are of course documented.
>
> So no printf, no error message, just an error code.
>
This would mean that you can't give a useful context message. In other
words, iif something goes wrong and you have only a code (which is a
generic error), you have to go in and add more debug code to get more
info. It's much better to have a real error message sent so that the
message is useful for debugging.
--
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder
paperCrane --Justin Patrin--