Win32 specific: SEH handler on background thread. Catches Windows

structured exceptions (hard crashes, segmentation faults...),
converts them to Slic3r::HardCrash exceptions and displays the exception
using the usual PrusaSlicer way.
The SEH handler is installed on the main background slicing thread
as of now, therefore hard crashes in TBB worker threads are not handled.
This commit is contained in:
Vojtech Bubnik 2021-06-22 09:53:23 +02:00
parent c64ce8777f
commit c0715866ff
3 changed files with 154 additions and 17 deletions

View file

@ -15,6 +15,7 @@ class Exception : public std::runtime_error { using std::runtime_error::runtime_
SLIC3R_DERIVE_EXCEPTION(CriticalException, Exception);
SLIC3R_DERIVE_EXCEPTION(RuntimeError, CriticalException);
SLIC3R_DERIVE_EXCEPTION(LogicError, CriticalException);
SLIC3R_DERIVE_EXCEPTION(HardCrash, CriticalException);
SLIC3R_DERIVE_EXCEPTION(InvalidArgument, LogicError);
SLIC3R_DERIVE_EXCEPTION(OutOfRange, LogicError);
SLIC3R_DERIVE_EXCEPTION(IOError, CriticalException);