bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#37480: 27.0.50; uncaught exception


From: Eli Zaretskii
Subject: bug#37480: 27.0.50; uncaught exception
Date: Sun, 22 Sep 2019 17:50:25 +0300

> From: Christian Johansson <christian@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?





reply via email to

[Prev in Thread] Current Thread [Next in Thread]