|
From: | Daniel Colascione |
Subject: | Re: Why doesn't dbus-handle-event catch all errors? |
Date: | Mon, 24 Feb 2014 00:39:18 -0800 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 |
On 02/24/2014 12:37 AM, Michael Albinus wrote:
Daniel Colascione <address@hidden> writes: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.There is the special error type `dbus-error'. Any handler could catch lisp errors and transform them into something which is understandable to another process. You do not want to send "(wrong-type-argument listp 42)" or something like this to another process, which isn't aware of Lisp.
Why not? It's more informative than "something went wrong".
Your handler shall include something like (defun my-dbus-method-handler (&rest args) (condition-case err (...) (error (signal 'dbus-error (list "Something went wrong, please try it again")))))
Sure. My point is that the framework should provide *something*, even if it's just the above, instead of silently dropping lisp errors and not telling callers that anything went wrong. Handlers that want to swallow errors can do so explicitly.
[Prev in Thread] | Current Thread | [Next in Thread] |