GNU bug report logs -
#37480
27.0.50; uncaught exception
Previous Next
Reported by: Christian Johansson <christian <at> cvj.se>
Date: Sun, 22 Sep 2019 14:03:01 UTC
Severity: normal
Tags: moreinfo
Found in version 27.0.50
Done: Stefan Kangas <stefan <at> marxist.se>
Bug is archived. No further changes may be made.
Full log
Message #11 received at 37480 <at> debbugs.gnu.org (full text, mbox):
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 <christian <at> cvj.se>
>> 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?
This bug report was last modified 5 years and 192 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.