Swi-cs-pl - A CSharp class library to connect .NET languages with SWI-Prolog
PlDomainException Constructor
SwiPlCs interface ► SbsSW.SwiPlCs.Exceptions ► PlDomainException ► PlDomainException()()()()
This class is the base class to catch exceptions thrown by prolog in C#.
Declaration Syntax
C# | Visual Basic | Visual C++ | F# |
public PlDomainException()
Public Sub New
public: PlDomainException()
new : unit -> PlDomainException
Examples
Copy | |
---|---|
public void prolog_exception_sample() { const string exceptionText = "test_exception"; Assert.IsTrue(PlQuery.PlCall("assert( (test_throw :- throw(" + exceptionText + ")) )")); try { Assert.IsTrue(PlQuery.PlCall("test_throw")); } catch (PlException ex) { Assert.AreEqual(exceptionText, ex.Term.ToString()); Assert.AreEqual("Unknown message: " + exceptionText, ex.Message); } } |
Assembly: SwiPlCs (Module: SwiPlCs.dll) Version: 1.1.60605.0 (1.1.60605.0)