View topic - Trap errors in a thread

Page 1 of 1

Trap errors in a thread

PostPosted: Mon May 03, 2021 8:35 am
by olivier_g
Hi

Is there a way to trap all errors including segmentation fault in a thread independently from other threads ?

Something like a try catch(...) in C++

Thank

Olivier

Re: Trap errors in a thread

PostPosted: Mon May 03, 2021 1:02 pm
by Tim
I don't fully understand your question.

Are you saying from Thread B, you want to trap all errors of Thread A? If that's what you mean, what exactly do you want to do if you detect such an error? Just log it or somehow allow Thread A to continue (which will be virtually impossible).

Are you wanting to do this in C or C++ and what's wrong with just using Try-Catch?

Tim