all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Daniel Colascione <dancol@dancol.org>
To: Michael Albinus <michael.albinus@gmx.de>
Cc: Emacs developers <emacs-devel@gnu.org>
Subject: Re: Why doesn't dbus-handle-event catch all errors?
Date: Mon, 24 Feb 2014 00:39:18 -0800	[thread overview]
Message-ID: <530B0536.7010907@dancol.org> (raw)
In-Reply-To: <87d2icgb4j.fsf@gmx.de>

On 02/24/2014 12:37 AM, Michael Albinus wrote:
> 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.

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.



      reply	other threads:[~2014-02-24  8:39 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
2014-02-24  8:39       ` Daniel Colascione [this message]

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=530B0536.7010907@dancol.org \
    --to=dancol@dancol.org \
    --cc=emacs-devel@gnu.org \
    --cc=michael.albinus@gmx.de \
    /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.