
9 Oct
2007
9 Oct
'07
6:15 a.m.
Hmmm - my code looks like this:
throw some_error() << BOOST_ERROR_INFO << boost::error_info< tag_error_code >( boost::system::error_code( errno, boost::system::errno_ec) );
As far as I know the point of the error category in boost::system is to classify the error code, so that error codes (integers) returned from different systems can coexist. I think that with boost exception, a better way to differentiate one integer (error code) from another is to just use different tags. In other words, instead of the code above, you'd have: throw some_error() << BOOST_ERROR_INFO << boost::error_info<tag_errno>(errno); where struct tag_errno: boost::error_info_value<int> { }; Emil Dotchevski