Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2003-01-10 11:30:13


"William E. Kempf" <wekempf_at_[hidden]> writes:

>> From: David Abrahams <dave_at_[hidden]>
>> "William E. Kempf" <wekempf_at_[hidden]> writes:
>>
>> >> From: Martin Brown <martin_w_brown_at_[hidden]>
>> >>
>> >> 2. The user needs a localised error message.
>> > Is the textual representation of the exception name
>> > enough? If not, how do you propose a library
>> > provide such a localised error message?
>> I will weigh in here with one strong opinion:
>> producing localized error messages should not be the
>> job of the exception object or the code which throws
>> it. Error message formatting and localization should
>> happen after exceptions are caught.
>
> Full agreement. But what (if anything) must the
> exception object provide in order for the exception
> handlers to be able to format a localized message?

You need to decide how much information you can give them. Just
package it up in data members of the exception object, document the
meaning of each one, and let the catcher worry about how to turn it
into an error message.

-- 
                       David Abrahams
   dave_at_[hidden] * http://www.boost-consulting.com
Boost support, enhancements, training, and commercial distribution

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk