I am interfacing SWI-Prolog with C# (in Unity) using swiplcs and I would like to catch prolog errors somehow (e.g. using a C# try-catch block) so my program (i.e. the Unity editor) does not crash.
However, using prolog queries inside C# try-cach blocks does not seems to work, my program (Unity) crashes.
Do you know how I could run prolog code safely so my program won’t crash when there is a prolog error somewhere ?
Thanks a lot for the help.
I saw that exceptions were of type PlException but I don’t know how to “catch” them either in Prolog or C# so that my program does not crash. Any idea?
I know that the C# interface is very old, but this is the only I found to interface prolog with C#. Do you know viable alternatives? I head about the Machine Query Interface, but as far as I know, there only is an implementation for Python, implementing it in C# is beyond my skills.