IDL language

Havoc Pennington havoc.pennington at gmail.com
Mon May 11 20:37:34 PDT 2009


Hi,

On Mon, May 11, 2009 at 11:07 AM, Matthew Johnson <dbus at matthew.ath.cx> wrote:
> Havoc's point that there will always be unchecked exceptions which could
> be thrown notwithstanding, some languages might want to make them
> checked exceptions, so we shouldn't lose the information.
>

Even in languages with checked, though, some exceptions should be
checked (those that need handling) and some should not (those that
represent an unhandleable bug). Java uses RuntimeException and Error
for the unhandle-able, though the name (RuntimeException rather than
Bug or the like) has caused so much misuse of it that I think it ended
up breaking checked exceptions in Java and leading to backlash in C#
and many Java APIs like Hibernate.

GLib uses GError for handleable, and just an uncatchable warning
(return_if_fail) for the bugs.

Anyway I think it's important to be clear, if adding a facility to
list exceptions, whether listed exceptions are going to be handle-able
exceptions only (which is what I'd recommend). So "bad args" type
exceptions would not be listed. Also not listed might be say
out-of-memory or disconnected or timeout, which are presumed always
possible. (Though if an app actualiy wanted to deal with timeouts and
disconnection, having those be checked could be useful, presumably
listing them per-method when they can happen for all methods, is not
useful.)

Havoc


More information about the dbus mailing list