[Top][All Lists]

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

Re: Why doesn't dbus-handle-event catch all errors?

From: Daniel Colascione
Subject: Re: Why doesn't dbus-handle-event catch all errors?
Date: Fri, 21 Feb 2014 00:13:47 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0

On 02/20/2014 11:22 PM, Michael Albinus wrote:
Daniel Colascione <address@hidden> writes:

dbus-handle-event uses a condition-case that catches dbus-error, but
errors in general. Why don't we send all lisp errors from handler
functions back to callers as dbus errors?

Because they aren't dbus errors. If your handler has some stupid code
like `(car 42)', the resulting lisp error `(wrong-type-argument listp 42)'
shouldn't be shown as *dbus* error.

Any nonlocal exit of a dbus handler message handler ought to be a dbus error: that nonlocal exit results in a program that expects a dbus reply not getting one at all.

You're free to write a handler which returns any error as dbus error, if
your program logic requires this.

The only reasonable implementation of a dbus handler is one that transforms lisp errors to dbus errors, so why not do that automatically in dbus.el? Silently swallowing lisp errors is the less common case, and if a program needs to do that, it can wrap its logic in ignore-errors inside the handler.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]