Boost logo

Boost :

From: Kevin Sopp (baraclese_at_[hidden])
Date: 2006-07-03 08:55:45


>After the promising initial interest in the Exception lib I wrote, I ported
>the source code to Boost, and posted a link to the documentation. But so
>far
>there has not been even a single reply to my post :|

Hello, I found the idea very appealing, I just didnt come around to review
it yet. Here are my comments:

- I don't like the word failed as in 'throw failed<my_error>' it seems
strange to throw a "failed error", that's the way I read it anyway. I can't
come up with a better one right now though.

- There should be a way to iterate over all exception_info objects
contained. This is useful in a case where you don't know what information
was attached to the exception. Then you just want to print everything that
can be translated via lexical_cast to a logfile to get the maximum
information on the exception regardless.

- The file read error example under "Adding strings" in the docs should be
mentioned much earlier in the text. Because this is I believe a very common
scenario. And it's always good to start with a simple example.

- I don't think it's a good idea to have a tag mechanism to access each info
field. It's inconvenient having to declare the tag. Of course strings can be
abused.. but that's C++. I believe simple string keys are enough and very
descriptive and easy to use.

- why not create an operator << () that automatically does the wrapping via
exception_info_wrapper instead of having a wrap_string(), wrap_errno()...

- I don't like the dynamic_cast involved in getting the info object. It may
be enough to hide it in a small inline function if (exception_info* xi =
get_exception_info(&x))

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/


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