For my reference:
https://swi-prolog.discourse.group/t/exceptions-in-foreign-code-more-questions/3527
https://swi-prolog.discourse.group/t/foreign-language-interface-handling-prolog-exceptions-in-c/1807
https://swi-prolog.discourse.group/t/exception-in-foreign-c-code/4504
prolog_exception_hook/4
(I didn’t find anything in https://groups.google.com/g/swi-prolog)