hi gang,
so the problem with these, and what we're trying to fix is one of
policy : what's the right error to return. jeremy noted:
> Also, you don't HAVE to return a ReadResult::ReadStatus enum directly;
> it can also be a string (I submitted a patch for this a long time ago)
> giving some useful error message; in this case, the status is set to
> ERROR_IN_READING_FILE.
and i wrote a few days back the 'policy' for the enums:
> > > FILE_NOT_HANDLED, //!< file is not appropriate for this file
> > > reader, due to some incompatibility, but *not* a read error
> > > FILE_NOT_FOUND, //!< file could not be found or could not be read
> > > FILE_LOADED, //!< file successfully found, loaded, and converted
> > > into osg
> > > FILE_LOADED_FROM_CACHE, //!< file found in cache and returned
> > > ERROR_IN_READING_FILE //!< file found, loaded, but an error was
> > > encountered during processing
which brings me to my proposal:
1) the policy for errors is to fit them into the appropriate enum
buckets first. however...
2) if an actual file error is encountered, the user may then (and
only then) return a string
as jeremy's patch enables.
this gives us consistent error reporting, with optional details when
an actual error is encountered.
thoughts?
bob
--
bob kuehne
founder and ceo - blue newt software
www.blue-newt.com 734/834-2696
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org