At 10:18 AM 12/17/2002, Peter Dimov wrote:

>The main problem is that I don't really know the answer. I can tell you
>what doesn't work, but I don't know yet what works. :-)

How about these member functions (in addition to what()):

int native_error() const { return m_sys_err; }
// Note: a value of 0 implies a library (rather than system) error

error_code error() const { return m_err; }

const string & function() const;
// name of the function throwing the exception

const path & path1() const; // argument 1 to function; may be empty()
const path & path2() const; // argument 2 to function; may be empty()

Code catching the exception with then have all the information that was available at the point the exception was thrown.

The practical impact is to add one string and two paths to the implementation of filesystem_error. I can live with that; filesystem_errors are a commonplace so worth bending over backward to report fully, and in a way that can be internationalized however the user desires.

Comments?

--Beman


_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Reply via email to