Errors and the introspection format
Daniel P. Berrange
dan at berrange.com
Sat Feb 18 08:27:30 PST 2006
On Sat, Feb 18, 2006 at 10:44:34AM +0000, Matthew Johnson wrote:
> On Fri, 17 Feb 2006, Havoc Pennington wrote:
> >On Fri, 2006-02-17 at 18:11 +0000, Matthew Johnson wrote:
> >>So, Java will expose this in the programming API, and everything else
> >>will just
> >>list it as another annotation, this is fine, but the introspection data
> >>contain all the API, and this includes error conditions.
> >The most important part of the API is the semantic documentation of the
> >method's contract. i.e. what happens when you call the method.
> I agree and I think that what errors can be thrown is a vital part of
> that contract exactly as much as what signals can be sent.
As I see it, introspection data should be considered to be providing hints
as to the API exported - for example some services don't provide introspection
data at all, but it doesn't mean they don't export any methods. Some services
don't provide data for return types, but they may still return values. So
going along a similar line, if a method does not provide a list of exceptions,
it doesn't mean that it won't throw exceptions, just that it is not providing
hints about the exceptions thrown.
The Perl bindings, for example, may well throw all sorts of exceptions, but
since there is no reflection support in the runtime, there's no way we could
provide a [reliably complete] list of exceptions in the introspection data.
So, in summary I'm not against having a way to detail exceptions thrown
in introspection data, but bindings should not treat such information
as gospel, only as a hint.
|=- GPG key: http://www.berrange.com/~dan/gpgkey.txt -=|
|=- Perl modules: http://search.cpan.org/~danberr/ -=|
|=- Projects: http://freshmeat.net/~danielpb/ -=|
|=- berrange at redhat.com - Daniel Berrange - dan at berrange.com -=|
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Desc: Digital signature
Url : http://lists.freedesktop.org/archives/dbus/attachments/20060218/edfdaee7/attachment.pgp
More information about the dbus