On Mon, Feb 15, 2010 at 11:22 PM, Adam Badura
In my use case I throw upon error during Windows Registry manipulation. One of the data attached to the exception object is the path to the registry key on which operation failed. The problem however is that sometimes (while the library is still developed...) the failure is due to internal code error: the handle to the key is no longer valid because it was closed (erroneously) previously.
Is this situation a bug? If that's the case I'd do something like: PathInfo assert_path_info( std::string const & s ) { assert(!s.empty()); return PathInfo(s); } .... BOOST_THROW_EXCEPTION(ExceptionType() << assert_path_info(getPath(hKey)));
Can anything be done about it? Can we have some form of conditional error_info insertion?
template <class Info>
struct cond_info
{
typename Info::value_type value;
bool cond;
cond_info( typename Info::value_type const & value, bool cond ):
value(value), cond(cond)
{
}
};
template