From: "Daniel P. Berrange" <berrange@redhat.com>
To: Ian Pratt <m+Ian.Pratt@cl.cam.ac.uk>
Cc: Anthony Liguori <aliguori@us.ibm.com>, xen-devel@lists.xensource.com
Subject: Re: Re: Error reporting capabilities for libxc
Date: Tue, 24 Oct 2006 00:05:03 +0100 [thread overview]
Message-ID: <20061023230503.GA1817@redhat.com> (raw)
In-Reply-To: <3AAA99889D105740BE010EB6D5A5A3B205073F@paddington.ad.cl.cam.ac.uk>
On Mon, Oct 23, 2006 at 11:15:21PM +0100, Ian Pratt wrote:
> > > 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.
>
> That's precisely my point. The various bits of metadata can be
> parameters passed back along with the error code. It's possible that
> some callers will be able to do things with the metadata that are more
> useful than just printing the string. I guess the error parameters could
> be returned as a va_list. Many callers would just call back into the
> library to get the appropriate error string.
Ahh, I mis-read your comment a little. That is certainly one possibility
although I'm not entirely a fan of va_list as an API - perhaps either a
struct with a handful of generic data fields for returning metadata, or
a union switched on the error code would work - it'd be nice to be able
to copy all the bits around without needing memory allocation in any of
the error handling paths.
Regards,
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 -=|
next prev parent reply other threads:[~2006-10-23 23:05 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-26 12:58 Error reporting capabilities for libxc Ian Pratt
2006-09-26 13:20 ` Daniel P. Berrange
2006-10-23 18:00 ` Daniel P. Berrange
2006-10-23 19:17 ` Anthony Liguori
2006-10-23 19:27 ` Daniel P. Berrange
2006-10-23 20:04 ` Anthony Liguori
2006-10-23 20:08 ` Daniel P. Berrange
2006-10-23 20:54 ` Ian Pratt
2006-10-23 20:57 ` Daniel P. Berrange
2006-10-23 21:10 ` Ian Pratt
2006-10-23 21:14 ` Anthony Liguori
2006-10-23 21:28 ` Daniel P. Berrange
2006-10-23 21:38 ` Anthony Liguori
2006-10-23 21:47 ` John Levon
2006-10-24 9:15 ` Daniel Veillard
2006-10-23 21:48 ` Daniel P. Berrange
2006-10-24 7:47 ` Gerd Hoffmann
2006-10-24 9:07 ` Keir Fraser
2006-10-24 10:26 ` Gerd Hoffmann
2006-10-23 21:21 ` Daniel P. Berrange
2006-10-23 22:15 ` Ian Pratt
2006-10-23 23:05 ` Daniel P. Berrange [this message]
2006-10-23 20:40 ` John Levon
2006-10-23 21:04 ` John Levon
2006-10-23 21:09 ` Daniel P. Berrange
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20061023230503.GA1817@redhat.com \
--to=berrange@redhat.com \
--cc=aliguori@us.ibm.com \
--cc=m+Ian.Pratt@cl.cam.ac.uk \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.