[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] Re: Error reporting capabilities for libxc



On Mon, Oct 23, 2006 at 10:10:31PM +0100, Ian Pratt wrote:
> > > Do we actually need pointers? I'd much rather go with __thread.
> > 
> > Well, we need a char buffer to store the error message, since that has
> much
> > more useful info than the error code alone. I could always just do a
> fixed
> > 200 byte buffer, and truncate anything longer than this which would
> also
> > actually remove the annoying OOM problem in copying the error message.
> 
> Would we be better off returning an error code and a set of parameters,
> requiring a call-back into the library to get the string? 

That assumes that there is a static mapping between an error code
and the error description, which there isn't. The error description
can contain info about actual bits of metadata which were incorrect.
For example when reporting an invalid ELF architecture, it can tell
you exactly what ELF arch was found & what was expected.

> It's worth thinking about future language localisation here too.

Yep, I don't see any trouble adding localization to this API. We'd just
feed the error messages through gettext before passing them into the
xc_set_error method.

Dan.
-- 
|=- Red Hat, Engineering, Emerging Technologies, Boston.  +1 978 392 2496 -=|
|=-           Perl modules: http://search.cpan.org/~danberr/              -=|
|=-               Projects: http://freshmeat.net/~danielpb/               -=|
|=-  GnuPG: 7D3B9505   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505  -=| 

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.