Subject: Re: bug#33782: 27.0.50; Emacsclient ignores errors when its frame is deleted

From: Noam Postavsky <[email-masked]>
Date: Tue, 09 Jul 2019 22:05:36 -0400

reopen 33782
tags 33782 - notabug
quit

Lars Ingebrigtsen <[email-masked]> writes:

> Philipp <[email-masked]> writes:
>
>> Assuming an Emacs server is running:
>>
>> $ emacsclient --create-frame --eval '(unwind-protect (error "foo") (delete-frame))' ; echo $?
>> 0
>>
>> This means that if the frame created by Emacsclient is deleted, errors
>> are ignored.  This seems like a bug; I wouldn't expect errors to be
>> ignored in this case, because they should bubble up through the
>> `unwind-protect' form.
>
> Well...  like
>
> (unwind-protect (error "foo") (message "zot"))
>
> there's no error bubbling, and there's no error to be returned, so I
> think this is correct behaviour?

No, that's incorrect, unwind-protect doesn't catch errors, it just
executes the handler forms (in this case (message "zot")) before the
error finishes bubbling.