
16 Aug
2010
16 Aug
'10
12:08 p.m.
On 16/08/10 14:01, fabien.castan@free.fr wrote:
exception are just here to gather and carry diagnostic info, not full fledged error message
If you throw a bad_alloc, you don't need to add a full fledged error message, I agree that the localization and the exception type is sufficient.
No, I mean that if you do advanced string manipulation in the exception itself, you may screw up, adn cause a bad_alloc beign thrown and masking your own exception.
When you throw a logic_error, more the message is clear, precise and detailed better it is.
Just make your own, informative exception type deriving from logic_error.