From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#37480: 27.0.50; uncaught exception Date: Mon, 23 Sep 2019 19:37:56 +0300 Message-ID: <83d0frotnf.fsf@gnu.org> References: <838sqgqtam.fsf@gnu.org> <8336goqr10.fsf@gnu.org> <06831c73-1a16-7e53-e872-f3fe97df534d@cvj.se> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="40463"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 37480@debbugs.gnu.org To: Christian Johansson Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Sep 23 18:48:50 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iCRW6-000ANZ-1r for geb-bug-gnu-emacs@m.gmane.org; Mon, 23 Sep 2019 18:48:50 +0200 Original-Received: from localhost ([::1]:59704 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCRW3-0004R4-Kh for geb-bug-gnu-emacs@m.gmane.org; Mon, 23 Sep 2019 12:48:47 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33988) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCRMf-0005Eb-Dr for bug-gnu-emacs@gnu.org; Mon, 23 Sep 2019 12:39:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iCRMe-0003jt-Do for bug-gnu-emacs@gnu.org; Mon, 23 Sep 2019 12:39:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:56331) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iCRMb-0003jA-S7 for bug-gnu-emacs@gnu.org; Mon, 23 Sep 2019 12:39:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iCRMb-0003En-OR for bug-gnu-emacs@gnu.org; Mon, 23 Sep 2019 12:39:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 23 Sep 2019 16:39:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 37480 X-GNU-PR-Package: emacs Original-Received: via spool by 37480-submit@debbugs.gnu.org id=B37480.156925668912353 (code B ref 37480); Mon, 23 Sep 2019 16:39:01 +0000 Original-Received: (at 37480) by debbugs.gnu.org; 23 Sep 2019 16:38:09 +0000 Original-Received: from localhost ([127.0.0.1]:36919 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iCRLl-0003DB-El for submit@debbugs.gnu.org; Mon, 23 Sep 2019 12:38:09 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:53579) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iCRLj-0003CR-O9 for 37480@debbugs.gnu.org; Mon, 23 Sep 2019 12:38:08 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:53326) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1iCRLe-0003OY-5F; Mon, 23 Sep 2019 12:38:02 -0400 Original-Received: from [176.228.60.248] (port=3678 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1iCRLd-0001Zu-36; Mon, 23 Sep 2019 12:38:01 -0400 In-reply-to: <06831c73-1a16-7e53-e872-f3fe97df534d@cvj.se> (message from Christian Johansson on Mon, 23 Sep 2019 07:18:25 +0200) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:167019 Archived-At: > Cc: 37480@debbugs.gnu.org > From: Christian Johansson > Date: Mon, 23 Sep 2019 07:18:25 +0200 > > Alright, I didn't know about that function. Can you give an example of > how to use it? It tried the following but it doesn't work, it seems the > thread dies after the signal and I'm not sure were it exits. > > (make-thread >  (lambda() >    (message "Start of asynchronous thread") >    (signal 'error '("Fatal error")) >    (message "End of asynchronous thread") >    (message "Last error %s" (thread-last-error)))) This function is supposed to be used by a thread other than the one that hit the error. > For my ssh-deploy plugin, sometimes a asynchronous process or thread > gets an error, could be network issues for instance and I would like to > be able to handle these cases. If you want to handle the error in the thread which gets the error, just use condition-case or similar construct in that thread. If you want to handle the error in another thread, thread-last-error is for you.