unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: help-gnu-emacs@gnu.org
Subject: Re: Error does not throw to debugger in 'when' block
Date: Thu, 12 Jan 2023 10:28:35 +0200	[thread overview]
Message-ID: <83o7r4kvgs.fsf@gnu.org> (raw)
In-Reply-To: <AM9PR09MB49772A185234D2F00C9D3D4196FD9@AM9PR09MB4977.eurprd09.prod.outlook.com> (message from Arthur Miller on Thu, 12 Jan 2023 07:51:01 +0100)

> From: Arthur Miller <arthur.miller@live.com>
> Date: Thu, 12 Jan 2023 07:51:01 +0100
> 
> When running this little code, I have observed that 'error' does not end in
> debugger:
> 
> (defun new-patch (&optional patch-name)
>   (interactive "sPatch name: ")
>   (let ((path (expand-file-name patch-name)))
>     (message "PATH: %s" path)
>     (when (file-exists-p path)
>       (error "A worktree with this name already exists"))))
> 
> If I run this code, I see it correctly executes error, but it does not open
> debugger. If I place cursor after the error form, debugger is
> opened. Value of debug-on-error is 't.
> 
> This is output in *Messages* buffer for 'Emacs -Q':
> 
> PATH: /home/arthur/repos/emsrc/28.2
> progn: A worktree with this name already exists
> Mark set [2 times]
> 
> Just curious, is this intended new behaviour for 'error' or a bug?

How exactly do you "run this code"?  The details matter.



  reply	other threads:[~2023-01-12  8:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-12  6:51 Error does not throw to debugger in 'when' block Arthur Miller
2023-01-12  8:28 ` Eli Zaretskii [this message]
2023-01-12  9:08   ` Arthur Miller
2023-01-12 11:26     ` Michael Heerdegen
2023-01-12 19:18       ` Arthur Miller
2023-01-12 21:15         ` Michael Heerdegen
2023-01-12 22:49           ` Arthur Miller

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83o7r4kvgs.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=help-gnu-emacs@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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).