From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Christian Johansson Newsgroups: gmane.emacs.bugs Subject: bug#37480: 27.0.50; uncaught exception Date: Sun, 22 Sep 2019 17:26:28 +0200 Message-ID: References: <838sqgqtam.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="258635"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 Cc: 37480@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Sep 22 17:27:15 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 1iC3la-00157A-74 for geb-bug-gnu-emacs@m.gmane.org; Sun, 22 Sep 2019 17:27:14 +0200 Original-Received: from localhost ([::1]:47334 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iC3lY-0004fg-El for geb-bug-gnu-emacs@m.gmane.org; Sun, 22 Sep 2019 11:27:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47995) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iC3lQ-0004fV-2p for bug-gnu-emacs@gnu.org; Sun, 22 Sep 2019 11:27:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iC3lO-0004FU-Uc for bug-gnu-emacs@gnu.org; Sun, 22 Sep 2019 11:27:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53756) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iC3lO-0004FH-Fp for bug-gnu-emacs@gnu.org; Sun, 22 Sep 2019 11:27:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iC3lO-0003DW-7j for bug-gnu-emacs@gnu.org; Sun, 22 Sep 2019 11:27:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Christian Johansson Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 22 Sep 2019 15:27:02 +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.156916599412323 (code B ref 37480); Sun, 22 Sep 2019 15:27:02 +0000 Original-Received: (at 37480) by debbugs.gnu.org; 22 Sep 2019 15:26:34 +0000 Original-Received: from localhost ([127.0.0.1]:34343 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iC3kv-0003Ch-Nj for submit@debbugs.gnu.org; Sun, 22 Sep 2019 11:26:33 -0400 Original-Received: from cvj.se ([31.192.230.63]:48716) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iC3kt-0003CY-Rj for 37480@debbugs.gnu.org; Sun, 22 Sep 2019 11:26:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=cvj.se; s=x; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To:Subject; bh=vgA2uUXCMxUy9tQCgL86ohfX0xOiLIzyaCfQPgCMPMg=; b=A6x6EYGeuLzOS8aq7coNu+DCEB08bpyXXHWSaoXngA0kJ9o9v8gg9WZ0YF9yFA4M1c0kMBQp7YmnwRsO9ghESxxja4hnqZovUTrPEknzmwatXBgH7aephtY9k05kgr048iNOU1+pY4wU5rB8vMsD7nz1DIpgDRkATrgLoS5Ezsg=; Original-Received: from c-2f5ee255.011-155-65736b4.bbcust.telenor.se ([85.226.94.47] helo=Christians-MacBook-Air.local) by cvj.se with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1iC3kr-0002pg-TL; Sun, 22 Sep 2019 17:26:30 +0200 In-Reply-To: <838sqgqtam.fsf@gnu.org> Content-Language: en-US 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:166912 Archived-At: Hi! Alright, I would like to do something like this: (condition-case     nil     (make-thread      (lambda()        (message "Start of asynchronous thread")        (signal 'error '("Fatal error"))        (message "End of asynchronous thread")))   (message "Catched error")) I have a case were a error occurs inside a tramp thread and I would like to be able to handle it Hälsningar / Best Regards Christian On 2019-09-22 16:50, Eli Zaretskii wrote: >> From: Christian Johansson >> Date: Sun, 22 Sep 2019 16:00:38 +0200 >> >> I want to handle errors occurring in asynchronous threads like in this >> example, is it possible? > For some value of "possible". From the ELisp manual: > > When code run by a thread signals an error that is unhandled, the > thread exits. Other threads can access the error form which caused the > thread to exit using the following function. > > -- Function: thread-last-error > This function returns the last error form recorded when a thread > exited due to an error. Each thread that exits abnormally > overwrites the form stored by the previous thread’s error with a > new value, so only the last one can be accessed. > >> (make-thread >> (lambda() >> (message "Start of asynchronous thread") >> (signal 'error '("Fatal error")) >> (message "End of asynchronous thread"))) > I'm not sure I understand what you tried to accomplish with this code. > It doesn't seem to handle errors in any way. Could you explain what > you are trying to do?