diff --git a/doc/motivation.html b/doc/motivation.html index 4118a3b..5815986 100644 --- a/doc/motivation.html +++ b/doc/motivation.html @@ -61,9 +61,9 @@ read_file( FILE * f, char const * name )

Exception wrapping

The idea of exception wrapping is to catch an exception from a lower level function (such as the read_file function above), and throw a new exception object that contains the original exception (and also carries a file name.) This method seems to be particularly popular with C++ programmers with Java background.

Exception wrapping leads to the following problems:

-
  1. To wrap an exception object it must be copied, which may result in slicing.
  2. +
    • To wrap an exception object it must be copied, which may result in slicing.
    • Wrapping is practically impossible to use in generic contexts.
    • -
+

The second point is actually special case of violating the exception neutrality principle. Most contexts in a program can not handle exceptions; such contexts should not interfere with the process of exception handling.

The boost::exception solution