From: Michael Albinus <michael.albinus@gmx.de>
To: Daniel Colascione <dancol@dancol.org>
Cc: Emacs developers <emacs-devel@gnu.org>
Subject: Re: Why doesn't dbus-handle-event catch all errors?
Date: Mon, 24 Feb 2014 09:37:00 +0100 [thread overview]
Message-ID: <87d2icgb4j.fsf@gmx.de> (raw)
In-Reply-To: <53070ABB.2090202@dancol.org> (Daniel Colascione's message of "Fri, 21 Feb 2014 00:13:47 -0800")
Daniel Colascione <dancol@dancol.org> 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.
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")))))
Best regards, Michael.
next prev parent reply other threads:[~2014-02-24 8:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-21 4:37 Why doesn't dbus-handle-event catch all errors? Daniel Colascione
2014-02-21 7:22 ` Michael Albinus
2014-02-21 8:13 ` Daniel Colascione
2014-02-24 8:37 ` Michael Albinus [this message]
2014-02-24 8:39 ` Daniel Colascione
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=87d2icgb4j.fsf@gmx.de \
--to=michael.albinus@gmx.de \
--cc=dancol@dancol.org \
--cc=emacs-devel@gnu.org \
/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.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
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.