Swi-cs-pl - A CSharp class library to connect .NET languages with SWI-Prolog
PlDomainException Constructor (message)
SwiPlCs interface ► SbsSW.SwiPlCs.Exceptions ► PlDomainException ► PlDomainException(String)
This class is the base class to catch exceptions thrown by prolog in C#.
Declaration Syntax
C# | Visual Basic | Visual C++ | F# |
public PlDomainException( string message )
Public Sub New ( message As String )
public: PlDomainException( String^ message )
new : message : string -> PlDomainException
Parameters
- message (String)
-
[Missing <param name="message"/> documentation for "M:SbsSW.SwiPlCs.Exceptions.PlDomainException.#ctor(System.String)"]
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)