Re: Standardized way of interpolating variables into PEAR_Exceptionmessages?
| From: | Alan Langford | Date: | Mon, 25 Sep 2006 12:58:17 +0000 |
| Subject: | Re: Standardized way of interpolating variables into PEAR_Exceptionmessages? | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-44048@lists.php.net to get a copy of this message | ||
On 2006 09 24 13:44, Justin Patrin wrote:
On 9/24/06, Alan Langford <jal@ambitonline.com> wrote:Just one point of clarification. There's no way I want to replace the text message. I was suggesting that in the event of an error that might be described as "Error 15: Permission failure in process 'foo' while executing method 'bar'", that the exception have contents similar to this: ['code'] = 15 ['message'] (as above) ['process'] = 'foo' ['method'] = 'bar' This makes it a lot easier for someone doing I8N to prepare their own message, after understanding the English version, of course. My suggestion was that we strongly recommend (if not require) that packages pass all data used to assemble a variable error message as separate components of the exception, thus making the I8N process far easier. Thanks for your other comments, I am beginning to get a better handle on all of this now.One of the problems with most error/exception mechanisms is that they have a real inclination to take all the semantically meaningful data, jam it into an unparsable string, and pass it back as an error message.1) Error message strings have to be there in order to give any useful information to the developer.