On 2022-05-29 23:00, Ali Çehreli wrote:
On 5/29/22 13:53, Christian Köstlin wrote:
> According to
>
https://www.schveiguy.com/blog/2022/05/comparing-exceptions-and-errors-in-d/
> its bad to catch Errors ...
Correct in the sense that the program should not continue after catching
Error.
> so dowork should catch only Exception?
It should catch Error as well. Otherwise you will have no idea why a
thread disappeared. You may agree with me here:
https://youtu.be/dRORNQIB2wA?t=1950
Thanks a lot for this explanation!
Probably a try catch (Throwable) is a good thing to have in any thread
that does not only use nothrows ...
I catch'ed Throwable in the code just because it's a quick little
experiment.
> it might be better
> to crash directly ...
Sounds good but only after leaving the reason behind somehow.
Ali
Kind regards,
Christian