- Why throw exceptions? (as opposed to using error codes)
- When to throw an exception.
- When not to throw an exception.
Any condition that prevents a method/function from completing its designed objective should result in an exception being thrown. These conditions can arise from invalid input data (a precondition error) or a failure to generate valid output data (return values, class invariants, etc).
For a more complete explanation read:
When and How to Use Exceptions
C/C++ Users Journal August, 2004
1 comment:
Hi,
I just want to thank you for your kind praise. Hope you enjoyed Ystad and welcome back!
Post a Comment