The Right Approach to Exceptions

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Sat Feb 18 18:56:16 PST 2012


On 2/18/12 8:38 PM, Jonathan M Davis wrote:
> On Saturday, February 18, 2012 20:30:45 Andrei Alexandrescu wrote:
>> On 2/18/12 6:40 PM, H. S. Teoh wrote:
>>> One word: internationalization. Then toString() falls flat on its face.
>>
>> No. I happen to have some expertise in the area as I've participated to
>> two large and heavily internationalized systems. i18n has everything to
>> do with string tables and formatting templates and emphatically nothing
>> to do with exception hierarchies. The only possible link is that
>> exceptions should provide the necessary hooks.
>
> They do in that if you want to print a message because of that exception, you
> need to print something in the correct language, and that won't work with
> toString unless the exception type has built-in internationalization of some
> kind - regardless of what that internationalization mechanism might be.

Of course. toString is not a solution to internationalizing exceptions 
(or any complex messages).

Andrei




More information about the Digitalmars-d mailing list